(可以在OnDestroy或者你认为需要释放资源的时机)
Bitmap leftBitmap = ((BitmapDrawable) iv.getDrawable()).getBitmap();
ivLeftAvatar.setImageDrawable(null);
if (leftBitmap != null && !leftBitmap.isRecycled()){
leftBitmap.recycle();
leftBitmap = null;
}
System.gc();
更多推荐
android开发清除ImageView背景圖片
发布评论