Best practice for hiding the keyboard:
InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
It will automatically get the current focus and hide the keyboard. It doesn't matter how many EditText views you have.
source share