Android - what is the meaning of StableIDs?

android, listview

Solution

Stable IDs allow the `ListView` to optimize for the case when items remain the same between `notifyDataSetChanged` calls. The IDs it refers to are the ones returned from `getItemId`.

Without it, the `ListView` has to recreate all `View`s since it can't know if the item IDs are the same between data changes (e.g. if the ID is just the index in the data, it has to recreate everything). With it, it can refrain from recreating `View`s that kept their item IDs.

Problem

I'm implementing a ListAdapter of ExpandableListView, while working i see that i need to overide the function boolean hasStableIds(). Can anyone explain please what is the meaning of stable ids? when I need this?

Original source