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

Adam Burley
  • 5,551
  • 4
  • 51
  • 72
Archie.bpgc
  • 23,812
  • 38
  • 150
  • 226
  • sorry, the Next button appears but when i click it doesnt take the cursor to the next EditText, same problem with all the AutoCompleteTextViews i am using, for EditText it works fine – Archie.bpgc Sep 11 '12 at 11:25

4 Answers4

23

Set android:imeOptions="actionNext" in AutoCompleteTextView in xml .

Chirag
  • 56,621
  • 29
  • 151
  • 198
16

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

Nobody Special
  • 1,255
  • 1
  • 10
  • 14
  • 1
    Using `android:inputType="text"` and `android:imeOptions="actionNext"` works for me, but when I click the **Next** button, I'm not taken to the next view. Is there anything I need to add to the next view? – ban-geoengineering Jun 12 '17 at 13:01
5

Just add this two below lines. It will be fine.

android:imeOptions="actionNext"
android:inputType="text"

or,

android:imeOptions="actionDone"
android:inputType="text"
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Shaon
  • 2,496
  • 26
  • 27
4

I had same issue with My AutoCompleteTextView. It was working fine before android:singleLine="true" deprecated. But once i set android:maxLines="1",it is not worked until i put android:inputType="text"

AutoCompleteTextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:maxLines="1"
    android:inputType="text"
    android:imeOptions="actionNext"
    />

by placing android:inputType="text" on the AutoCompleteTextView it worked for me.

may help you guys :)

Arshad
  • 945
  • 9
  • 11