android:imeOptions="actionNext" does not go to the next EditText

416 views Asked by At

I have encountered a strange behaviour of android:imeOptions="actionNext". When I press next on the keyboard it actually navigates out of the AutoCompleteEditText but doesn't focus on the next one. I am using the same setting for my other EditTexts and it works fine.

Here is the .xml code:

<AutoCompleteTextView
    android:id="@+id/email"
    android:layout_width="match_parent"
    android:layout_height="@dimen/login_form_height"
    android:hint="@string/prompt_email_username"
    android:imeOptions="actionNext"
    android:inputType="textEmailAddress"
    android:maxLines="1"
    android:padding="@dimen/login_form_padding" />

<EditText
    android:id="@+id/password"
    android:layout_width="match_parent"
    android:layout_height="@dimen/login_form_height"
    android:hint="@string/prompt_password"
    android:imeActionId="6"
    android:imeActionLabel="@string/action_sign_in_short"
    android:imeOptions="actionUnspecified"
    android:inputType="textPassword"
    android:maxLines="1"
    android:padding="@dimen/login_form_padding" />

So when I press next it leaves "@+id/email" but doesn't focus on "@+id/password". Any ideas?

1

There are 1 answers

1
Jitesh Prajapati On

android:singleLine="true" or android:inputType="text" can solve your problem

<AutoCompleteTextView
    android:id="@+id/email"
    android:layout_width="match_parent"
    android:layout_height="@dimen/login_form_height"
    android:hint="@string/prompt_email_username"
    android:singleLine="true"
    android:inputType="text"
    android:imeOptions="actionNext"
    android:maxLines="1"
    android:padding="@dimen/login_form_padding" />