D
D
doxtarzlo2015-08-22 22:11:45
Java
doxtarzlo, 2015-08-22 22:11:45

Why is AutocompleteTextView not editable after threshold is exceeded?

Good afternoon
The problem is this: I use the most direct and standard approach to creating an AutocompleteTextView, namely:

AutoCompleteTextView autoCompleteTextView = (AutoCompleteTextView) findViewById(R.id.auto_complete_text_view);
autoCompleteTextView.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_dropdown_item_1line, arrayList));

XML:
<AutoCompleteTextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/auto_complete_text_view"
        android:hint="@string/hint"
        android:completionThreshold="1"
        android:dropDownWidth="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:scrollHorizontally="true"
        android:ellipsize="end"
        android:lines="1"
        android:maxLines="1"
        android:layout_marginLeft="@dimen/external_margin"
        android:layout_marginRight="@dimen/external_margin"
        android:layout_marginBottom="@dimen/external_margin"
        />

The application starts up, the dropdown appears, but I can't enter more than one character in the input field (or more than n characters depending on the value of threshold). If you select something from the list, the input field cannot remove the selected option.
In examples on the Internet, addTextChangedListener with empty methods is also hung on AutocompleteTextView . I don’t understand why, since the behavior of AutocompleteTextView remains unchanged even without it (at least for me).
I feel like I'm missing something.
I will be grateful for help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question