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.