I have a password input dialog
in the Android fragment
. When using the soft keyboard, if a password is wrong a dialog will still show and focus will stay in the editText
input box.
The problem is, when a user uses physical keyboards and the password is not right, the focus will be on the cancel button (I have two buttons
in the dialog
, cancel is on the left and OK is on the right). How can I set the focus on the editText
? I've tried to use the requestFocus()
function, but it does not work.