在我的應用程序中,我想交換圖像當用戶點擊它時在運行時。刪除繪圖緩存
有兩個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