Situation:
I'm developing an app, which is some sort of photo frame app (there's 16 frames user can choose from), which consists of:
- ViewPager with maximum 5 ListView. (Off screen limit is set to 1, so we can assume only 3 ListViews will be in memory)
- Each ListView has 17 view types (16 frames + Loading view)
We all know Android saves our off-screen rows as convertView in memory. So, in my situation, worst case, I might end up with 17 convertViews * 3 ListView = 51 views in my memory (maybe less, maybe more, not important).
While simple 51 Views wouldn't consume a lot of memory (I assume). My views are all filled up with decent bitmap, which is fairly big memory consumption.
Question:
Is there anyway I can detect a view becoming off-screen (or becoming convertView) so that I can instantly release the reference to its drawable?
My Progress:
I've been looking at adt bundle's source code (Api 16) for AbsListView on putting a scrapView into RecycleBin, I believe the detection can be done there but that would require me to customize the whole class. My worry is older Api can't support what within Api 16, so I'm asking here to see if there is any other better options.
Thank you for your time.