什么是对API的调用bitmap.recycle()11+呢? [英] What does calling bitmap.recycle() on API 11+ do?
问题描述
我知道的机器人的API 10之前,重要的是要调用再循环(),选择那些不再使用位图,由于实际的原始数据存储在本机存储器中。
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 .
不过,由于API 11,位图存储在堆中,所以我的问题是:
however , as of API 11 , bitmaps are stored in the heap , so my question is:
时,它仍然需要调用位图的循环()API是否足够大(至少11个)?这是什么做的,如果我把它称为这样的API?
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 ?
推荐答案
官方文件告诉循环()
现在是一个先进的呼叫,所以如果你想释放你的位图你可以只写像位= NULL
和GC将采取一切照顾。
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.
这篇关于什么是对API的调用bitmap.recycle()11+呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!