0

I am making an Async request to download some data once the data is downloaded i clear the old list and add the new items in the onPostExecute() of the Async to the adapter of AutoCompleteTextView and I call

adapter.setNotifyOnChange(true);
adapter.notifyDataSetChanged();

But i am not able to show the dropdown again ?? Any suggestion would be most appreciated

2 Answers2

0

I solved it here is the solution

All I needed was to reinitialze the variable and call the notify the dataset has changed

arrayAdapter =  new ArrayAdapter<String> (this,android.R.layout.select_dialog_item,newDownloadedList);
AutoCompleteTextView.setAdapter(arrayAdapter);
arrayAdapter.notifyDataSetChanged();
  • 1
    @M-WaJeEh : I tried but didnt work so used that, Please read the question first –  Nov 26 '13 at 18:05
  • @M-WaJeEh: Yes I did came across that but that also didnt help –  Dec 08 '13 at 03:19
0

you can use this

   arrayAdapter =  new ArrayAdapter<String> 
   (this,android.R.layout.select_dialog_item,newList);
   AutoCompleteTextView.setAdapter(arrayAdapter);
   arrayAdapter.notifyDataSetChanged();

then call AutoCompleteTextView.showDropDown();

Mahmoud Mabrok
  • 1,362
  • 16
  • 24