I am hiding the keyboard after a text edit, but th...
# compose
g
I am hiding the keyboard after a text edit, but the keyboard stays in the field. Is there a way to unfocus the field?
Copy code
override fun hideKeyboard() {
        val activity : Activity = context as Activity
        val imm: InputMethodManager = activity.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
        var view = activity.currentFocus
        if (view == null) {
            view = View(activity)
        }
        imm.hideSoftInputFromWindow(view.windowToken, 0)
    }