AusR wrote:
> I am displaying a listview where the view used for each row includes
> an ImageView and TextView, with the image displayed dependant on the
> contents of the TextView. the images are at this testing phase pngs
> approx 600bytes each, dimensions of max 100x35 px.
> 
> I have noticed on both a large list and scrolling all the way through
> (500+ items) or a small list (~20 items) and scrolling up and down, up
> and down, I eventually reach an Out Of Memory error.
> 
> How can I overcome this by possibly 'unloading' the images (or row
> item views) once they are no longer in view.

Are you recycling the views that come back to you in getView() (or
bindView())?

I cover this technique in the later posts in this series:

http://androidguys.com/?s=fancy+listviews

Forgive the formatting problems, and bear in mind that the older posts
are for the M5 SDK and may require minor modifications to work on the
current Android SDK.

You might also look at Romain Guy's Shelves application, particularly
with an eye towards how he handles all of his book cover images, to see
if there is anything more you would need to do to make sure your images
get properly garbage collected.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to