android:nextFocusForward is going to the wrong EditText

just place this inside your first edittext. Also replace nextFocusForward with nextFocusDown

<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:nextFocusDown="@+id/createAccount_txtLastName">
 <requestFocus />
</EditText>

It seems to be bugged when running this code on the emulator. However, it works on phones


It might be that your XML is ignored by Android focus algorithm. Documentation says following:

In rare cases, the default algorithm may not match the intended behavior of the developer. In these situations, you can provide explicit overrides with the following XML attributes in the layout file: nextFocusDown, nextFocusLeft, nextFocusRight, and nextFocusUp.

I had similar problem and i solved it by using nextFocusDown.

More on official documentation


None of the solutions worked for me except for listening for editor action listener and programmatically setting the focus to the next EditText.

    mFirstName.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            mLastName.requestFocus();
            return true;
        }
    });