Autocompletion delay

前端 未结 4 496
予麋鹿
予麋鹿 2020-12-17 06:33

I\'ve got to set an autocompletion for my application.

I\'ve already understood the AutoCompleteTextView operation, but I\'d like to dynamically modify the Stri

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-17 07:27

    I have got the same problem. The data comes but the autocompleteTextView doesn't update. The reason why the data is not updated is because the adapter didn't inform that the dataset has been changed.

     //use this at the initialization part for the autocompleteTextView
     autocompleteTextView.setThreshold(1);
     myAdapter.setNotifyOnChange(true);
     autocompleteTextView.setAdapter(myAdapter);
    
     // use this when you get new dataset and will show on autocompleteTextView
     myAdapter.notifyDataSetChanged();
    

提交回复
热议问题