I have an Activity with some EditText fields and some buttons as a convenience for what normally would be used to populate those fields. However when we the user touches on
Simply use below method
private fun hideKeyboard(activity: Activity, editText: EditText) { editText.clearFocus() (activity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager).hideSoftInputFromWindow(editText.windowToken, 0) }