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>
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>
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>
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