<AutoCompleteTextView
android:id="@+id/product"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="product"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="15dp" />
this is my code for AutoCompleteTextView.
The problem is I want to type in some text and then click Next
on the soft-keyboard. Next
is appearing on the soft-keyboard but its not taking cursor to the next EditText
. In the same screen rest all EditText have the same code and they work fine. Is AutoCompleteTextView any different from normal EditText
in such case??
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.
Defines the hint view displayed in the drop down menu. Defines the number of characters that the user must type before completion suggestions are displayed in a drop down menu.
Set android:imeOptions="actionNext"
in AutoCompleteTextView in xml .
Setting android:inputType="text"
on the AutoCompleteTextView
element in the layout XML worked for me; limits input to one line and the Next
soft key is present. Pressing the Next
soft key didn't actually advance input to the next AutoCompleteTextView
in my Activity until I also added android:imeOptions="actionNext"
.
I couldn't find anything in the reference site to support this, but Content Assist in Eclipse seems to indicate android:singleLine
is deprecated (at least in this context):
Constrains the text to a single horizontally scrolling line instead of letting it wrap onto multiple lines, and advances focus instead of inserting a newline when you press the enter key. * Deprecated: This attribute is deprecated. Use "maxLines" instead to change the layout of a static text, and use the "textMultiLine" flag in the inputType attribute instead for editable text views (if both singleLine and inputType are supplied, the inputType flags will override the value of singleLine). [boolean]"
Just add this two below lines. It will be fine.
android:imeOptions="actionNext"
android:inputType="text"
or,
android:imeOptions="actionDone"
android:inputType="text"
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