I have a layout consisting of a LinearLayout with a vertical orientation containing several EditTexts. The virtual keyboard of each of these EditTexts has a "next" button. Pressing the "next" button moves the cursor to the EditText below it.
However, somewhere in the middle of these EditTexts I added another LinearLayout, this one horizontal, with a few EditTexts inside of it. This leaves me with several EditTexts stacked vertically, then a few EditTexts on 1 row horizontal to each other, and then more EditTexts stacked vertically underneath.
The tab order begins as before, but when it reaches the first EditText of the horizontal LinearLayout, hitting the "next" button doesn't move to the next EditText to its right. It skips the two to the right and moves down to the EditText below.
How can I achieve the tab order I desire?
I've attached an image, a true work of art really, of the order I want
use android:nextFocusDown="your next id edit text". Example :
....
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/editText1"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:nextFocusDown="@+id/editText2" />
<EditText
android:id="@+id/editText2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
....
Look into using the XML tags nextFocusDown/Forward/etc. Documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With