Halo Great People?
I am new learning Kotlin.
I am trying to programmatically tap on a button on the keyboard after its called.
Here, after when focused on an edit text, calling showKeyboard(), the keyboard appears, I would like to tap on a key, (e.g. 'a') programmatically.
here's what I have so far...
button.setOnClickListener {
showKeyboard()
/** If possible have the code to tap on a button programmatically here...*/
}
private fun showKeyboard() {
val imm = this.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0)
}
Any help is highly appreciated! Thanks, take care.