Last active
August 29, 2015 14:02
-
-
Save laaptu/bc9242423b4b01c30ba9 to your computer and use it in GitHub Desktop.
Hiding soft keyboard programmatically. The view passed should not be null and it doesn't matter that the view is to be the current edittext where there is focus. It can be any view until and unless it is present in the layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void hideSoftInputKeyBoard(View view) { | |
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); | |
if (imm != null && view != null) { | |
imm.hideSoftInputFromWindow(view.getWindowToken(), 0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment