Hiding keyboard after calling new Activity that shows a ProgressDialog

后端 未结 5 1398
误落风尘
误落风尘 2021-02-06 11:43

I\'m having trouble with the on screen keyboard. I have an activity with an EditText which shows the keyboard, and a button to go to a second activity. The second a

5条回答
  •  误落风尘
    2021-02-06 12:10

    Have you tried:

    InputMethodManager im = (InputMethodManager)
    this.getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE);
    
    im.hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(),
    InputManagerMethod.HIDE_NOT_ALWAYS);
    

    This is the code I throw in at points I want to hide the keyboard.

提交回复
热议问题