-1

I have 2 same identical EditText:

<EditText        
android:id="@+id/card_num_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:digits="0123456789"
android:ems="13"
android:inputType="phone"
android:singleLine="true"
android:textSize="14sp"
/>

Other one:

<EditText
android:id="@+id/phoneRegEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:digits="0123456789"
android:ems="13"
android:inputType="phone"
android:singleLine="true"
android:textSize="14sp" />

One of them have a "next one" action button when the virtual keyboard shows up, the other have an "ok" action button.

The "next one" is passing focus to the next EditText but the "ok" is doing nothing just hiding the virtual keyboard.

enter image description here enter image description here

My question is, what conditions decide which button is showing up? In my opinion Android have a huge deficiency with EditText's focus flow.

Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222
  • http://stackoverflow.com/questions/3459168/imeoptions-actionnext-programmatically-how-to-jump-to-next-field/30010936#30010936 – IntelliJ Amiya Jul 07 '15 at 10:52

1 Answers1

2

It is done by IME_OPTIONs More info here

<EditText android:id="@+id/some_edittext"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:imeOptions="actionDone"><!-- Here you set whatever option you want -->

Lester
  • 2,544
  • 4
  • 27
  • 38