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

jul picture jul · Jan 26, 2012 · Viewed 24.6k times · Source

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).

Answer

waqaslam picture waqaslam · Jan 26, 2012

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