I have a ListView which can show some AnimationDrawables that are quite memory intensive. It's unlikely more than 2 of these would be visible on screen, but there can easily be dozens in the items that make up the list.
My issues is that my ListAdapter seems to get called for every item in the list. I assume that this is so that the ListView can set it's scroll height. But it means that I'm loading all those AnimationDrawables (that use lots of memory) that I don't need.
Is there a way to determine if a call to ListAdapter is for a non visible row? This would allow me to skip loading these expensive objects that will likely never need to appear on screen.