7

I am trying to show the soft keyboard on a custom manually coded text field. I use the following code and I get the standard keyboard with a return character at the bottom right.

inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);

I would like to display the keyboard that has the OK (or perhaps it's DONE) in the bottom right. When I did some research I found that the inputType can be set on the EditText (which I'm not using in this case), but not for the view i'm using (GLSurfaceView).

Any ideas how I can get the alternative keyboard showing?

EDIT I tried the solution posted here: - Multiline EditText with Done SoftInput Action Label on 2.3 but unfortunately it didn't show the DONE button (I am on Android 2.1). I tried changing the inputType field and that did change the type (i tried "phone"), but not the DONE button.

Thanks for your help.

Community
  • 1
  • 1
Ash McConnell
  • 1,340
  • 1
  • 17
  • 28

1 Answers1

13

If you want to obtain Done button on soft keyboard, you should set the "Ime options" of EditText field to actionDone

<EditText android:text="EditText" android:layout_width="fill_parent"
android:id="@+id/editText1" android:layout_height="wrap_content"
android:imeOptions="actionDone"/>
woodshy
  • 4,085
  • 3
  • 22
  • 21