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?
First you need to set the android:imeOptions attribute equal to actionDone for your target EditText as seen below. That will change your 'RETURN' button in your EditText's soft keyboard to a 'DONE' button.
Hiding the Soft Keyboard Programmatically You can force Android to hide the virtual keyboard using the InputMethodManager, calling hideSoftInputFromWindow, passing in the token of the window containing your edit field. This will force the keyboard to be hidden in all situations.
A floating action button (FAB) is a circular button that triggers the primary action in your app's UI. This page shows you how to add the FAB to your layout, customize some of its appearance, and respond to button taps.
The soft keyboard (also called the onscreen keyboard) is the main input method on Android devices, and almost every Android developer needs to work with this component at some point.
In your layout, just set the XML attributes android:imeOptions="actionNext"
for your first three text boxes and android:imeOptions="actionDone"
for the last one.
See: android:imeOptions documentation
Also, there's a small XML example in the training docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With