How to close Android Soft KeyBoard programmatically?

前端 未结 14 1313
别跟我提以往
别跟我提以往 2020-12-02 16:33

I am currently showing softkeyboard using the following code

InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
im         


        
14条回答
  •  渐次进展
    2020-12-02 17:12

    You could also try

    this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
    

提交回复
热议问题