Can't change soft keyboard enter to "done" button after upgrading to gingerbread

android, android-2.3-gingerbread, keyboard

Solution

I have seen this problem also and I believe it occurs when you have not set an `inputType`. Actually all `imeOptions` properties (along with a few others) get ignored completely if the `inputType` is set to `EditorInfo.TYPE_NULL` (the default).

So give one of these a shot (I picked `next` but you can put any type in):

XML:

    android:inputType="text"
    android:imeOptions="actionNext"

JAVA

    text.setInputType(EditorInfo.TYPE_CLASS_TEXT);
    text.setImeOptions(EditorInfo.IME_ACTION_NEXT);

And if you really want to go nuts you can use `setImeActionLabel('Add', SOME_ID)` and completely configure the action key (there are xml equivalentes also).

That being said. I could be completely wrong about your individual device but I figured this is easy to test and seems to always solve my problem so I should share.

Problem

very simply: `inputField.setImeOptions(EditorInfo.IME_ACTION_DONE);` used to make my soft keyboard show the "done" key instead of carraige return. Since I updated my phone (Samsung Galaxy S) to gingerbread this line of code is having no effect. Any ideas?

Original source