In my app I am working with ExpandableListView
. I am using adapter which extends BaseExpandableListAdapter
. I want to refresh the ExpandableListView
.
My ExpandableListView
consists of items with delete button which links with database.
If I'll press the delete button that item is permanently deleted from db. But the listview
is not refreshing at the same time. If I again run that activity its refreshing but not at same time.
I am using
mAdapter.notifyDataSetChanged();
but its not working as I want. Why?
I just called super on the following overridden method of the BaseExpandableListAdapter and since then the notifyDataSetChanged() works.
@Override
public void registerDataSetObserver(DataSetObserver observer) {
super.registerDataSetObserver(observer);
}
you can try to additionally call invalidateViews() on your ExpandableListView when refreshing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With