【发布时间】:2017-11-04 20:28:50
【问题描述】:
我对在 imageview 中使用我的回收位图有疑问。
我使用此代码在 imageview 中回收图像。
drawable = imglist1.getDrawable();
if (drawable instanceof BitmapDrawable) {
BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
Bitmap bitmap = bitmapDrawable.getBitmap();
bitmap.recycle();
}
我在 onDestroy 方法中调用它
@Override
protected void onDestroy() {
super.onDestroy();
...
}
我在 imageviews 中有图像(位图) 打开新活动时(调用 onDestroy() )
打开新活动后在 android 监视器内存中看不到变化。
安卓显示器
如何控制回收是否有效,或者如何减少内存?
内存来自图像视图中的大部分位图。
感谢您的意见
【问题讨论】:
标签: android memory bitmap recycle