Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable "Next" button on a EditText software keyboard (replace with "Done" button)

I have a bunch of EditTexts in my Android application, each with InputMethod set to numberSigned. My target device does not have a hardware keyboard and uses the software keyboard for numeric entry. Android replaces the standard "Done" button to the right of the entry box with a "Next" button. How can I use "Done" instead?

like image 593
Andrew Buss Avatar asked Apr 02 '10 19:04

Andrew Buss


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.

What is Imeoption android?

android:imeOptions="actionSend" /> You can then listen for presses on the action button by defining a TextView.OnEditorActionListener for the EditText element. In your listener, respond to the appropriate IME action ID defined in the EditorInfo class, such as IME_ACTION_SEND . For example: findViewById<EditText>(R.

How do I hide the keyboard on my android?

You can force Android to hide the virtual keyboard using the InputMethodManager, calling hideSoftInputFromWindow , passing in the token of the window containing your focused view. This will force the keyboard to be hidden in all situations. In some cases you will want to pass in InputMethodManager.


2 Answers

Try adding android:imeOptions="actionDone" to your EditText.

Reference

like image 105
Jim Blackler Avatar answered Sep 25 '22 11:09

Jim Blackler


This can also be accomplished in code with:

myEditText.setImeOptions(EditorInfo.IME_ACTION_DONE); 
like image 21
tomwhipple Avatar answered Sep 24 '22 11:09

tomwhipple