Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does calling bitmap.recycle() on API 11+ do?

I know that before API 10 of Android, it was important to call recycle() for Bitmaps that aren't used anymore, since the actual raw data is stored in the native memory.

However, as of API 11, Bitmaps are stored in the heap, so my question is:

Is it still needed to call recycle() on Bitmaps if the API is large enough (at least 11)? What does it do if I call it on such API?

like image 762
android developer Avatar asked Aug 14 '12 14:08

android developer


1 Answers

Official documentation tells that recycle() now is an advanced call so if you want to free your bitmap you can just write something like bitmap = null and GC will take care of everything else.

like image 93
s0nicYouth Avatar answered Nov 20 '22 07:11

s0nicYouth