AutoCompleteTextView - prohibition of the drop-down list when closing when calling notifyDataSetChanged

I use my own Adapter and my own Filter to populate an AutoCompleteTextView . Everything works fine, except that every time I call notifyDataSetChanged , the dropdown list closes and then opens again with new sentences (which is annoying).

What I'm trying to achieve is the same behavior as Google. When you enter a word, the drop-down list is simply filled with new values ​​(without reopening). Are there any workarounds?

PS

Adapter populated in Filter#publishResults :

 @Override protected void publishResults(CharSequence constraint, FilterResults results) { if(results == null) { return; } mAdapter.clear(); //notifyDataSetChanged is NOT called here List<?> content = (List<?>) results.values; final int size = content.size(); for(int i=0; i<size; i++) { mAdapter.add((City) content.get(i)); } mAdapter.notifyDataSetChanged(); } 
+4
source share

All Articles