In layout XML it is possible to specify android:imeOptions="actionNext"
which adds Next
button in virtual keyboard and by clicking on it - focus jumps to the next field.
How to do this programmatically - e.g. based on some event trigger focus to go to the next field?
Just suggestion, if you are using
it doesn't work, make sure that your EditText is using a single line.
The kotlin pendant
There is always necessity to add extra keys apart from default keys available in virtual
QWERTY
keyboard.Using XML
By Programmatic Way
An
EditorInfo
is most useful class when you have to deal with any type of user input in your Android application.IME_ACTION_DONE:
This action performs a “done” operation for nothing to input and the IME will be closed.For more information you may visit http://developer.android.com/reference/android/view/inputmethod/EditorInfo.html
Search for the next focusable field and than invoke
requestFocus()
.You can use the constants from EditorInfo class for the IME options. like,