87

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?

Andrew Buss
  • 1,532
  • 2
  • 14
  • 23

2 Answers2

217

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

Reference

Pang
  • 9,564
  • 146
  • 81
  • 122
Jim Blackler
  • 22,946
  • 12
  • 85
  • 101
  • 1
    but after selecting the text in edittext, Done button changes in to EDIT button and show cut,copy,paste..how to disable this. – Monty Dec 27 '12 at 10:14
  • 1
    What about Multi-Line EditTexts? This doesn't seem to work for them. :/ – Sheharyar Aug 11 '13 at 11:06
  • 7
    @SheharyarNaseer the input type for a multiline EditText needs to be the following in your EditText XML: `android:inputType="textImeMultiLine"`. Then the `android:imeOptions` will be work. – macklinu Dec 04 '13 at 20:07
  • Hi, Thanks for this. I face some issue if i am wrong please correct me , This work in some device and not some of. In HTC and Asus that Done not shown and in Samsung device that Done Visible. :) – Dharmik Patel Sep 12 '14 at 13:23
  • Note : This solution is also working well for Xamarin : YourEditText.ImeOptions = Android.Views.InputMethods.ImeAction.Done; – YumeYume Jun 01 '17 at 09:31
55

This can also be accomplished in code with:

myEditText.setImeOptions(EditorInfo.IME_ACTION_DONE);
tomwhipple
  • 2,850
  • 27
  • 28