Created
October 20, 2018 06:24
-
-
Save reline/648c41bf75f0488b231d3fc47cced309 to your computer and use it in GitHub Desktop.
Android - hide keyboard
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
fun hideKeyboard() { | |
currentFocus?.windowToken?.let { | |
val imm = applicationContext?.getSystemService(InputMethodManager::class) | |
imm?.hideSoftInputFromWindow(it, InputMethodManager.HIDE_NOT_ALWAYS) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment