Created
February 18, 2018 16:40
-
-
Save nasrabadiAM/16d3cd415e0aa01bf3957feb4cfe6aac to your computer and use it in GitHub Desktop.
close software keyboard - android
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
View view = activity.getCurrentFocus(); | |
if (view != null) { | |
InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE); | |
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment