How to update expandable list view when adapter's data changes

后端 未结 2 1190
挽巷
挽巷 2020-12-16 23:50

I have an activity that extends ExpandableListActivity. I use SimpleCursorTreeAdapter to fill ExpandableListView. My layout contains list view and empty view. On app start E

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-17 00:16

    So, the answer is:

    1. Call cursor.requery() before calling adapter's notifyDataSetChanged() method.
    2. Save groups state in activity's onPause() method and restore in onResume() method.

提交回复
热议问题