AutocompleteTextView: on "NEXT" highlight next TextView, on "DONE", make keyboard disappear

MJB picture MJB · Apr 30, 2010 · Viewed 13.6k times · Source

I have two AutocompleTextViews and I want to switch to the next if the user presses "NEXT", and make the virtual keyboard disappear when he hits "DONE" at the second AutocompleTextView. So far, the buttons "NEXT"/"DONE" do nothing at all.... Unfortunately I found no resources addressing this problem.

Any suggestions? thx

EDIT: Just want to add that this was asked when Android was on version 2.3 or something like that.

Answer

cebru picture cebru · Dec 17, 2011

I ran into this problem and fixed it by setting the imeOptions on the AutocompleteTextView to actionNext.

Example:

<AutoCompleteTextView
    android:id="@+id/dialog_product_name"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:singleLine="true"
    android:completionThreshold="1"
    android:imeOptions="actionNext"
    />