我的函数,从 onResume() 运行不会导致键盘出现。
我做错了吗?
private void showKeyboard() {
InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
mgr.showSoftInput(txtSearch, InputMethodManager.SHOW_FORCED);
txtSearch.requestFocus();}