[done]notifyDataSetChanged() does not update ListActivity automatically

后端 未结 9 1749
甜味超标
甜味超标 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:27

    Try calling invalidate() on your ListView.

    0 讨论(0)
  • 2020-12-10 16:28

    As Franco pointed out, notifyDataSetChanged() is used to tell the ListView that the contents of its adapter have changed, not that it needs to redraw itself. You are just changing a setting that affects how something is rendered. Try calling refreshDrawableState to tell the list to redraw.

    0 讨论(0)
  • 2020-12-10 16:31

    call AbsListView.invalidateViews() on your listview after BaseAdapter.notifyDataSetChanged()

    0 讨论(0)
提交回复
热议问题