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?
Android ExpandableListView is a view that shows items in a vertically scrolling two-level list. It differs from a ListView by allowing two levels which are groups that can be easily expanded and collapsed by touching to view and their respective children items.
How do I change the icon on expandable list view? Post the listView row xml. @RajeshCP see update one. Onclick of the onItemClick function you can change the source of the group_indicator for that you need a uparrow button or else you can rotate the bitmap by some dregree and set it as a source for that ImageView.
You have to use Adapter's getChild(groupPosition, childPosition) method to retrieve the instance of child.
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:
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