public static void releaseImageViewResouce(ImageView imageView) {
if (imageView == null) return;
Drawable drawable = imageView.getDrawable();
if (drawable != null && drawable instanceof BitmapDrawable) {
BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
Bitmap bitmap = bitmapDrawable.getBitmap();
if (bitmap != null && !bitmap.isRecycled()) {
bitmap.recycle();
}
}
}
[Android Memory] 手动回收ImageVIew的图片资源
最新推荐文章于 2021-05-28 15:26:44 发布