Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

imeOption="actionNext" not working in TextInputLayout .

I am using floating hint from material design. I want to shift focus from one EditText to the next, So I have put imeOptions="actionNext" in all editTexts and imeOptions="actionDone in the last EditText. But focus is not shifting to next EditText.

Below is the snippet of my xml.

<android.support.design.widget.TextInputLayout
    android:id="@+id/streetWrapper"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/TextInputStyle">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Street/Locality *"
        android:imeOptions="actionNext"
        android:maxLines="1"/>

</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
    android:id="@+id/flatWrapper"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="@dimen/_10sdp"
    android:theme="@style/TextInputStyle">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Building Name / Flat Number*"
        android:imeOptions="actionNext"
        android:maxLines="1"/>

</android.support.design.widget.TextInputLayout>
like image 935
rajat44 Avatar asked May 04 '17 09:05

rajat44


2 Answers

Add attribute android:inputType="text" to your EditText.

Try this:

<android.support.design.widget.TextInputLayout
    android:id="@+id/streetWrapper"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Street/Locality *"
        android:imeOptions="actionNext"
        android:maxLines="1"
        android:inputType="text"/>

</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
    android:id="@+id/flatWrapper"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="@dimen/_10sdp">

    <EditText

        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Building Name / Flat Number*"
        android:imeOptions="actionNext"
        android:maxLines="1"
        android:inputType="text"/>

</android.support.design.widget.TextInputLayout>
like image 193
Ferdous Ahamed Avatar answered Oct 26 '22 20:10

Ferdous Ahamed


You should add android:imeOptions="actionNext" in EditText section.

<android.support.design.widget.TextInputLayout
    android:id="@+id/streetWrapper"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/TextInputStyle">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:imeOptions="actionNext"
        android:maxLines="1"
        android:inputType="text"/>
</android.support.design.widget.TextInputLayout>
like image 40
IntelliJ Amiya Avatar answered Oct 26 '22 19:10

IntelliJ Amiya