Created
August 21, 2017 07:06
-
-
Save kobeumut/40769635b4370e238a79b4dc3b3c57ce to your computer and use it in GitHub Desktop.
Close opened keyboard on Android programatically
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
//For Kotlin | |
val inputManager:InputMethodManager =getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager | |
inputManager.hideSoftInputFromWindow(currentFocus.windowToken, InputMethodManager.SHOW_FORCED) | |
//For Java | |
InputMethodManager inputManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); | |
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.SHOW_FORCED); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment