I have an android xml format and I want to specify the focus order of the fields when the user presses the next on the keyboard.
The documentation says that android: nextFocusForward = TARGET_ID should do this trick. But this is ignored on all of our test devices. Some older devices are running 2.3 and new Nexus devices running 4.1.
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <EditText android:textCursorDrawable="@null" android:id="@+id/firstname" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="6dp" android:layout_marginTop="6dp" android:layout_weight="1" android:singleLine="true" android:background="#00000000" android:textColor="#000" android:nextFocusForward="@+id/lastname" android:padding="2dp"/> <EditText android:textCursorDrawable="@null" android:id="@+id/lastname" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="6dp" android:layout_marginTop="6dp" android:layout_weight="1" android:background="#00000000" android:singleLine="true" android:textColor="#000" android:padding="2dp"/> </LinearLayout>
What am I doing wrong here? I just canβt understand. Thank you very much!
source share