I\'m displaying a list of contacts (name + picture) using the ListView. In order to make the initial load fast, I only load the names first, and defer picture l
According to the documentation:
void notifyDataSetChanged ()
Notify any registered observers that the data set has changed. ... LayoutManagers will be forced to fully rebind and relayout all visible views...
In my case, the items were not visible (then whole RecycleView was outside the screen), and later on when it animated in, the item views didn't refresh either (thus showing the old data).
Workaround in the Adapter class:
public void notifyDataSetChanged_fix() {
// unfortunately notifyDataSetChange is declared final, so cannot be overridden.
super.notifyDataSetChanged();
for (int i = getItemCount()-1; i>=0; i--) notifyItemChanged(i);
}
Replaced all calls of notifyDataSetChanged() to notifyDataSetChanged_fix() and my RecyclerView happily refreshing ever since...