Now, I try to hide the softkeyboard when user touch outside the keyboard:
((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE)) .hideSoftInputFromWindow(
In kotlin:
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager imm.hideSoftInputFromWindow(window.attributes.token, 0)
Or, If you have a view:
imm.hideSoftInputFromWindow(view.windowToken, 0)