在listview的adapter中 加载图片之后调用回收图片缓存的方法
BitmapDrawable bd = (BitmapDrawable) relativeLayout.getBackground();
BitmapDrawable bd = (BitmapDrawable) relativeLayout.getBackground();
if (bd != null) {
bd.setCallback(null);
if (bd.getBitmap() != null) {
if (!bd.getBitmap().isRecycled()) {
bd.getBitmap().recycle();
}
}
}
在getview的最后执行上面的函数时产生错误ava.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@2cc96c28
想请教一个这里的问题要如何解决?