_:ne295112b521d4c25a94fa435bed63201xb2
<http://schema.org/text>
"You can force Android to hide the virtual keyboard using the InputMethodManager, calling hideSoftInputFromWindow, passing in the token of the window containing your focused view.\n// Check if no view has focus:\nView view &#x3D; this.getCurrentFocus();\nif (view !&#x3D; null) {  \n    InputMethodManager imm &#x3D; (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);\n    imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n}\n\nThis will force the keyboard to be hidden in all situations. In some cases, you will want to pass in InputMethodManager.HIDE_IMPLICIT_ONLY as the second parameter to ensure you only hide the keyboard when the user didn&#x27;t explicitly force it to appear (by holding down the menu).\nNote: If you want to do this in Kotlin, use:\ncontext?.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager\nKotlin Syntax\n// Only runs if there is a view that is currently focused\nthis.currentFocus?.let { view -&amp;gt;\n    val imm &#x3D; getSystemService(Context.INPUT_METHOD_SERVICE) as? InputMethodManager\n    imm?.hideSoftInputFromWindow(view.windowToken, 0)\n}"
<https://find-error.com/questions/1109022/how-do-you-close-hide-the-android-soft-keyboard-programmatically>