在我的应用程序中,我想交换图像当用户点击它时在运行时。删除绘图缓存
有两个imageviews当用户点击第一个图像,然后在我取第一的ImageView图像的位图,并分配给第二imageview的此同一时间,我用点击第二图像下面的代码:
public Bitmap createBitmap(ImageView imageview) {
imageview.setDrawingCacheEnabled(true);
imageview.buildDrawingCache(false);
if(imageview.getDrawingCache() != null) {
Bitmap bitmap = Bitmap.createBitmap(imageview.getDrawingCache());
imageview.setDrawingCacheEnabled(false);
return bitmap;
} else {
return null;
}
}
代码工作正常,但缓存不清除每次和位图用前一次缓存创建,所以我怎么可以清除位图缓存?
plz使用这个你会得到答https://github.com/thest1/LazyList – himanshu
请选择你的答案 – breceivemail