我碰到這段代碼,但我想知道這段代碼做了什麼,InputMethodManager究竟是什麼以及我的類中應該在哪裏輸入這段代碼?它會進入onCreate()方法還是應該創建一個新的方法?再次,我想了解這種方法是如何工作的。在EditText視圖中輸入後隱藏鍵盤
感謝提前:)你的答案我感謝幫助
InputMethodManager inputManager =
(InputMethodManager) context.
getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(
this.getCurrentFocus().getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
請不要添加純代碼的答案。也可以添加關於答案的簡要說明。 –