-3

I am creating an app and I need help.

I want to create a EditText and when the user open the keyboard to fill the edit text, that keyboard must have the "OK"or "Done" button inside it.

Example:

Example

Thank you so much

Vinicius Martin
  • 129
  • 1
  • 14
  • 1
    Possible duplicate of [How do I make an Android EditView 'Done' button and hide the keyboard when clicked?](http://stackoverflow.com/questions/1919742/how-do-i-make-an-android-editview-done-button-and-hide-the-keyboard-when-click) – AL. May 11 '16 at 01:30

1 Answers1

4
  1. You need to use ime options action done
  2. You need to use single line (although deprecated)

example:

<EditText
        android:id="@+id/saveDialogEditText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:digits="abcdefghijklmnopqrstuvwxyz1234567890-_ ."
        android:hint="@string/enter_palette_name_hint"
        android:imeOptions="actionDone"
        android:inputType="textAutoComplete"
        android:singleLine="true"/>
daxgirl
  • 756
  • 4
  • 10