ListView Not Updating After Filtering

前端 未结 5 1955
清酒与你
清酒与你 2020-12-31 06:06

I have a ListView (with setTextFilterEnabled(true)) and a custom adapter (extends ArrayAdapter) which I update from the main UI thread whenever a new item is added/inserted.

5条回答
  •  猫巷女王i
    2020-12-31 06:47

    If I understand your problem well - do you call the notifyDataSetChanged() method? It forces the listview to redraw itself.

    listAdapter.notifyDataSetChanged();
    

    just use this whenever you do something (for instance: lazy-loading of images) to update the listview.

提交回复
热议问题