I'm trying to focus on the next edit text after the user fills one in. The code works absolutely fine with EditText
but when I apply it on AutoCompleteTextView
, the Next button in the keyboard doesn't work. The cursor stays where it is. This is the code I'm using:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightSum="11" > <AutoCompleteTextView android:id="@+id/etLN" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="3" android:ems="10" android:nextFocusDown="@+id/etC" android:inputType="textPersonName" > <requestFocus /> </AutoCompleteTextView> <EditText android:id="@id/etC" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="4" android:ems="10" android:hint="0.0" android:nextFocusDown="@+id/etD" android:inputType="numberDecimal" android:text="" /> <EditText android:id="@id/etD" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="4" android:ems="10" android:nextFocusDown="@+id/etLN2" android:hint="0.0" android:inputType="numberDecimal" android:text="" /> </LinearLayout>
Please tell me what's the correct way to do this. Thanks :)
android:completionThreshold This defines the number of characters that the user must type before completion suggestions are displayed in a drop down menu.
If you want to get suggestions , when you type in an editable text field , you can do this via AutoCompleteTextView. It provides suggestions automatically when the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.
In android, we can create an AutoCompleteTextView control in two ways either manually in an XML file or create it in the Activity file programmatically. First we create a new project by following the below steps: Click on File, then New => New Project. After that include the Kotlin support and click on next.
add this to your AutoCompleteTextView
android:imeOptions="actionNext"
and it should work.
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