My layout has 4 EditText views and a submit Button view. I need to have "Next" button for the first 3 EditText's and a "Done" button for 4th EditText field in place of a "New Line" key of soft keyboard.
How can this be done?
My layout has 4 EditText views and a submit Button view. I need to have "Next" button for the first 3 EditText's and a "Done" button for 4th EditText field in place of a "New Line" key of soft keyboard.
How can this be done?
I think what you're looking for is something like this:
It first one will take the user to the next field in the layout that accepts text. The second will close the IME (the soft keyboard).
In your layout, just set the XML attributes
android:imeOptions="actionNext"
for your first three text boxes andandroid:imeOptions="actionDone"
for the last one.See: android:imeOptions documentation
Also, there's a small XML example in the training docs.
to navigate the focus to the next edit field add
and for dismissing the softkey with done click add
on your layout :)
Add
android:singleLine="true"
in your button xml