天天看点

Android 获取EditText焦点后自动弹出软键盘

有时候我们跳转到某些页面时,希望能马上获取特定TextView的焦点并弹出软键盘

editText.setFocusable(true);
		editText.requestFocus();
		InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
		imm.toggleSoftInput(0,InputMethodManager.HIDE_NOT_ALWAYS);