I am working on an Android project and use android:nextFocusButton so that the user can press the next button on the soft keyboard to navigate the EditText without having to click on each edit text to change focus.
In the layout I ask the name of the user in a separate text EditText in a linear layout that is in the horizontal plane
Then on the next line, in another linear diagram, I ask for the name of the company. Below is a screenshot to show what I mean.

What I'm trying to do is in the text editor of the name, the user can click next, after which you should switch the focus to the text for editing the surname, then click the next text again, and he will go to the text for editing the company.
Instead of what happens, the first name has focus, the user clicks the next button, and it goes to the text of the company editing instead of the last name.
Below is a snippet of my XML layout
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <EditText android:id="@+id/createAccount_txtFirstName" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:hint="@string/first_name" android:singleLine="true" android:inputType="textCapSentences" android:nextFocusForward="@+id/createAccount_txtLastName"/> <EditText android:id="@+id/createAccount_txtLastName" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:hint="@string/last_name" android:singleLine="true" android:inputType="textCapSentences" android:nextFocusForward="@+id/createAccount_txtCompanyName"/> </LinearLayout> <EditText android:id="@+id/createAccount_txtCompanyName" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/company_name" android:singleLine="true" android:inputType="textCapSentences" android:nextFocusForward="@+id/createAccount_txtEmail"/>
source share