Closing IME onEditorAction

Hi everyone, first post on Stack, so be patient.

I am trying to close an IME after a user presses an input in an EditText.

I tried using android:imeOptions="actionDone"/"actionNext" in layout.xml

I set setOnEditorActionListener on the specified EditText and searched for code to signal this IME.

Tpx.

+4
source share
1 answer

It works just fine.

 InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0); 
+6
source

Source: https://habr.com/ru/post/1338109/


All Articles