您的位置:首页 > 其它

关于清空Imageview里bitmap 缓存数据

2014-10-20 11:06 435 查看
Bitmap leftBitmap = ((BitmapDrawable) iv.getDrawable()).getBitmap();

ivLeftAvatar.setImageDrawable(null);
if (leftBitmap != null && !leftBitmap.isRecycled()){
leftBitmap.recycle();
leftBitmap = null;
}
System.gc();
主要是对Imageview 执行<pre name="code" class="java">setImageDrawable()方法,将imageview内的bitmap清空。
当然这里最好回收下bitmap

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: