我試圖關閉我的自定義鍵盤後單擊gridview.Im試圖在BaseAdapter類中的項目。上下文來自InputMethodService。如何關閉/隱藏自定義鍵盤Android
到目前爲止,我已經試過如下:
FrameLayout scroll = (FrameLayout)inflater.inflate(R.layout.keyboard, null);
InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(scroll.getWindowToken(), 0);
-
imm.toggleSoftInput(0,InputMethodManager.HIDE_IMPLICIT_ONLY);
-
scroll.setVisibility(View.INVISIBLE);
感謝
沒有錯誤,但鍵盤仍然呈現 –