[done]notifyDataSetChanged() does not update ListActivity automatically

后端 未结 9 1759
甜味超标
甜味超标 2020-12-10 15:30

I\'ve got some troubles with notifyDataSetChanged() of a BaseAdapter. This method is called in refreshItems() and shall update the BaseAdapter of my ListActivity. On calling

9条回答
  •  心在旅途
    2020-12-10 16:13

    I encountered the same problem, and I tried to call notifyDataSetChanged() on the adapter. Besides, I also tried to call refreshDrawableState(), invalidateViews() on the view and none of those worked. All these methods are called in the UI thread. Then I found this How to clear the views which are held in the ListView's RecycleBin? . Finally setAdapter() worked, only if I create a new adapter.

提交回复
热议问题