问题
I know that before API 10 of Android, it was important to call recycle()
for Bitmap
s that aren't used anymore, since the actual raw data is stored in the native memory.
However, as of API 11, Bitmap
s are stored in the heap, so my question is:
Is it still needed to call recycle()
on Bitmap
s if the API is large enough (at least 11)? What does it do if I call it on such API?
回答1:
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.
来源:https://stackoverflow.com/questions/11954435/what-does-calling-bitmap-recycle-on-api-11-do