The answers are clear and correct, I'll add an idea for CursorAdapter
case here.
If youre subclassing CursorAdapter
(or ResourceCursorAdapter
, or SimpleCursorAdapter
), then you get to either implement ViewBinder
or override bindView()
and newView()
methods, these don't receive current list item index in arguments. Therefore, when some data arrives and you want to update relevant visible list items, how do you know their indices?
My workaround was to:
newView()
notifyDatasetChanged()
and refreshing all of themDue to view recycling the number of view references I'll need to store and iterate will be roughly equal the number of list items visible on screen.