To hide the input method editor, use InputMethodManager:
InputMethodManager imm=
(InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
You can use this from onEditorAction(), for example, as shown in this example project .
source
share