Keyboard order - Android
On Android, you can use several focus
properties to modify the keyboard focus order.
android:nextFocusForward
: set the next element to move focus to.android:nextFocusUp
: specify which element should receive focus when navigating upandroid:nextFocusDown
: specify which element should receive focus when navigating downandroid:nextFocusLeft
: specify which element should receive focus when navigating to the leftandroid:nextFocusRight
: specify which element should receive focus when navigating to the right
<View
android:id="@+id/notFocusable"
android:focusable="false"/>
<EditText
android:id="@+id/field1"
android:focusable="true"
android:nextFocusForward="@+id/field2"
android:nextFocusDown="@+id/field3"
android:nextFocusRight="@+id/field2"/>
<EditText
android:id="@+id/field2"
android:focusable="true"
android:nextFocusForward="@+id/field3"
android:nextFocusDown="@+id/field4"/>
<EditText
android:id="@+id/field3"
android:focusable="true"
android:nextFocusForward="@+id/field4"/>
<EditText
android:id="@+id/field4"
android:focusable="true"/>