Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Soft keyboard action button

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?

like image 574
Venkat Papana Avatar asked May 15 '11 07:05

Venkat Papana


People also ask

How do I change the Done button on my Android keyboard?

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.

How do I turn off soft keyboard on Android?

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.

What is action key Android?

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.

What is soft keyboard in Android?

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.


1 Answers

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.

like image 81
Martin Stone Avatar answered Sep 22 '22 05:09

Martin Stone