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

末鹿安然 提交于 2019-12-01 03:57:13

问题


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?


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!