I need to hide the soft keyboard in response to clicking a button. I saw some posts about this, and I tried it with:
InputMethodManager im = (InputMethodManager) getSystemService(
Context.INPUT_METHOD_SERVICE);
im.hideSoftInputFromWindow(myEditText1.getWindowToken(), 0);
That worked well. But now I have two EditText views. How can I now hide the soft keyboard, no matter wich EditText is selected? I tried it also with
InputMethodManager im = (InputMethodManager) getSystemService(
Context.INPUT_METHOD_SERVICE);
im.hideSoftInputFromWindow(myEditText1.getWindowToken(), 0);
im.hideSoftInputFromWindow(myEditText2.getWindowToken(), 0);
, but that didn't worked...
Thanks for your help!
EDIT: Found solution. Posted below.