当启动程序时,我想隐藏应用程序中的软键盘。我使用下面的代码,但是没有实现效果。请问如何隐藏应用程序中的软键盘?
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(notes.getWindowToken(), 0);
当启动程序时,我想隐藏应用程序中的软键盘。我使用下面的代码,但是没有实现效果。请问如何隐藏应用程序中的软键盘?
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(notes.getWindowToken(), 0);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);