My two cents: I recommend you to use a cache and define a logic to make bitmaps to expire at some point ( X seconds of not being display, etc)
This is a really good article about handling images and obviously its main subject, multithreading for performance. http://android-developers.blogspot.com/2010/07/multithreading-for-performance.html -f4 On Oct 14, 6:12 am, Lisa <lpk...@gmail.com> wrote: > please help me. 。゜゜(´□`。)°゜。 > > I am using android 1.6. > > my code to release a bitmap looks like this: > > if (imageBG != null) { > imageBG.recycle(); > imageBG = null; > > } > > but when I do get to the following error: (u_u,) > > 10-14 11:36:52.069: ERROR/AndroidRuntime(618): Uncaught handler: > thread main exiting due to uncaught exception > 10-14 11:36:52.089: ERROR/AndroidRuntime(618): > java.lang.RuntimeException: Canvas: trying to use a recycled bitmap > android.graphics.bit...@437d8e60 > 10-14 11:36:52.089: ERROR/AndroidRuntime(618): at > android.graphics.Canvas.throwIfRecycled(Canvas.java:955) > 10-14 11:36:52.089: ERROR/AndroidRuntime(618): at > android.graphics.Canvas.drawBitmap(Canvas.java:1044) > 10-14 11:36:52.089: ERROR/AndroidRuntime(618): at > android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:291) > ... > > What should I do? ~(・・?) > I do not know how to release memory. 。゜゜(´□`。)°゜。 > > please, help me.┌(_ _)┐ > > Thanks a lot for all your replies. m(_ _)m -- 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