I have 3 image resources in my app.
Loading and displaying any one of them in an ImageView goes smoothly.
But when I remove the displayed ImageView from the layout, null it and
add a new image, things get weird.

Either the process crashes completely (signal 11) when I try
calling .recycle() on the old bitmap or I get an OutOfMemoryError in
case I don't use recycle.

This only happens on API Levels below 8, so my guess is that bugs with
GC on the native heap are causing it and these bugs were fixed on
2.2.  However, since 2.1 is currently the most common version out
there I need a workaround...

Again, there shouldn't be a lack of memory for the native heap. I hold
only 1 image at a time and null the previous so the GC should be able
to retrieve the heap space (like happens on 2.2).

I've created a very small sample app which can be downloaded from
here:
http://www.4shared.com/file/QqHrhJLR/BitmapRecycleTest.html

Any suggestions will be appreciated.

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

Reply via email to