当EditText被选择,将会自动获得焦点,并且屏幕中会显示一个软键盘。
下面的代码将演示,如何关闭软键盘。
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(editTextField.getWindowToken(), 0);
当EditText被选择,将会自动获得焦点,并且屏幕中会显示一个软键盘。
下面的代码将演示,如何关闭软键盘。
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(editTextField.getWindowToken(), 0);