I have a layout which contains some views like this:
&
I tried the top answer by David Merriman and it also didn't work in my case. But I found the suggestion to run this code delayed here and it works like a charm.
val editText = view.findViewById(R.id.settings_input_text)
editText.postDelayed({
editText.requestFocus()
val imm = context.getSystemService(INPUT_METHOD_SERVICE) as? InputMethodManager
imm?.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT)
}, 100)