Do I need to Bitmap.recycle()?

207 views
Skip to first unread message

nagoya0

unread,
Aug 10, 2012, 3:25:00 AM8/10/12
to androi...@googlegroups.com
I display images on each row of Listview.
when I call aq.image(), or an activity finishes,
should I recycle old bitmaps?

Peter Liu

unread,
Aug 10, 2012, 4:31:19 AM8/10/12
to androi...@googlegroups.com, miso...@gmail.com
You mean the bitmap's recycle method?

Don't call that method because app will crash if the UI is displaying that image. 
AQuery mem cache is a LRU with a max size of 4M, so it will flush out the least used ones automatically. 

If you want to flush all images from memory call this:
Reply all
Reply to author
Forward
0 new messages