1

I guess I miss some little detail using AutocompleteTextView. Usage is quite straight and ordinary, as shown below:

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

App launches, dropdownlist appears, but I can't enter more than 1 symbol (or more than specified in threshold parameter). I can't neither delete more than 1 symbol if I've chosen some option from the list.

I suppose as you already understand, I need fully editable input field with dropdown "hints".

Thanks!

Anton
  • 449
  • 2
  • 7
  • 20
  • post your actual code: the code you posted is fake as `View` doesn't have `setAdapter` method – pskink Aug 22 '15 at 10:47
  • @pskink AutocompleteTextView has: http://developer.android.com/intl/ko/reference/android/widget/AutoCompleteTextView.html Edited. Don't post arrayList as there is complicated logic of retrieving this list. Actually, thats all what is related to AutocompleteTextView. – Anton Aug 22 '15 at 11:00
  • i dont know what you really mean: try this: http://stackoverflow.com/a/19860624/2252830 and type k i e v – pskink Aug 22 '15 at 12:26
  • @pskink I'm sorry, didn't try yet. I surely write here when I will. Thank you – Anton Aug 22 '15 at 16:31
  • just add that simple code snippet in your Activity's `onCreate` – pskink Aug 22 '15 at 16:37
  • @pskink I moved forward a bit with another tasks, but looking on that snippet I wonder how that code may help me as I have ArrayList and use ArrayAdapter, not SimpleCursorAdapter? Or I dont understand something? – Anton Aug 22 '15 at 19:46
  • whats the difference: `ArrayAdapter` or `SimpleCursorAdapter` ? – pskink Aug 23 '15 at 08:29
  • @pskink I created new issue due to a lot of new info: http://stackoverflow.com/questions/32270270/autocompletetextview-is-not-working-properly-in-listview-header – Anton Aug 28 '15 at 11:43

0 Answers0