In my (limited) experience you should only recycle a bitmap when it is
no longer referenced anywhere else, ie when the thing where you
stuffed the bitmap into is gone.

Having said that I recently have seen a problem where the recycling
worked fine on 2.3 but crashed on 1.5.  Go figure.

On Mar 9, 9:22 am, b_t <bartata...@gmail.com> wrote:
> Hi,
>
> when I use
>
> imageView.setImageResource(int) or
> imageView.setImageDrawable(packageManager.getApplicationIcon(packageName))
> or
> imageView.setImageDrawable(resolveInfo.loadIcon(packageManager))
>
> should I recycle bitmap inside the imageView when I change the image?
> Or not because the returned bitmaps are cached inside and
> can be used again?
>
> How can I decide if I have to recycle bitmaps or not?
>
> I don't have memory problems on my Desire but I can see that some
> Nexus One users have.
>
> T.

-- 
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