Hide soft keyboard after dialog dismiss

前端 未结 8 1697
孤街浪徒
孤街浪徒 2021-01-31 02:16

I want to hide soft keyboard after AlertDialog dismiss, but it\'s still visible. Here is my code:

alert = new AlertDialo         


        
8条回答
  •  抹茶落季
    2021-01-31 02:44

    I use this method:

    IBinder token = searchTextEntry.getWindowToken();
    ( ( InputMethodManager ) getSystemService( Context.INPUT_METHOD_SERVICE ) ).hideSoftInputFromWindow( token, 0 );
    

    Where searchTextEntry is the name of my EditText reference.

提交回复
热议问题