Search code examples
androidandroid-edittextandroid-softkeyboard

How can I get a "done" button in softkeyboard?


how can I have a "done" button in my softkeyboard (Samsung Galaxy 10.1, Android 3.1) when writing in an EditText?

Using

 <EditText
     android:id="@+id/comment"
     android:layout_width="772dp"
     android:layout_height="200dp"/>

I get

enter image description here

If possible, I'd also like to remove this "attachment" button.

Anybody can help?

EDIT

I managed to get a "Done" button using

android:inputType="textImeMultiLine",

but the "return" button disappeared...

How can I have both? (I asked this new question here).


Solution

  • add this to your EditText xml:

    android:imeOptions="actionDone"
    

    or, to set it from code:

    yourEditText.setImeOptions(EditorInfo.IME_ACTION_DONE);
    

    for more, read this