I am creating app Using ExpandableListView ,I referred some tutorials .The hasStableIds () set to false? what is the exact need for making hasStableIds() to false?
hasStableIds () in Expandable ListView?
Asked Answered
Documentation of hasStableIds()
Indicates whether the child and group IDs are stable across changes to the underlying data.
Returns whether or not the same ID always refers to the same object
It's used when you change the data of the Adapter, everytime you change the data the ExpandableListView
should update it's views to reflect the changes.
If true the ExpandableListView
can reuse the same View
if the ID is the same.
If false it should recreate all the views since it can't have any idea what changes.
The ID which i refer is the ID returned by getGroupId
and getItemId
.
You should override this methods too!
Some questions:
© 2022 - 2024 — McMap. All rights reserved.
getChildId
instead ofgetItemId
. – Olmsted