You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the field on a password screen activity
I would like for the keyboard to be displayed when the activity created instead of having the user to tap on the field.
Can i just check on how can i do this
The text was updated successfully, but these errors were encountered:
fun View.showSoftKeyboard() {
if (this.requestFocus()) {
val imm: InputMethodManager = this.context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.showSoftInput(this, InputMethodManager.SHOW_IMPLICIT)
}
}
// For Hide
fun View.hideSoftKeyboard() {
val imm = this.context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(this.windowToken, 0)
}
After that, you can use like this : binding.circlePin.showSoftKeyboard()
I have the field on a password screen activity
I would like for the keyboard to be displayed when the activity created instead of having the user to tap on the field.
Can i just check on how can i do this
The text was updated successfully, but these errors were encountered: