我想清除位图缓存,但我不知道如何清除位图.
我正在使用Koush Ion库来加载图片
try {
bitmap = Ion.with(context).load(URLimage).withBitmap().asBitmap().get();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ExecutionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
我需要在每次单击按钮时清除位图缓存.
提前致谢
解决方法:
使用Ion.getDefault(context).getCache().clear()清除文件缓存.
使用Ion.getDefault(context).getBitmapCache().clear()清除内存中的位图缓存.
Ion.dump()不会清除缓存.它只是将一些调试信息打印到日志中.您也可以查找它的源代码.
标签:android,caching,bitmap,ion-koush
来源: https://codeday.me/bug/20190609/1207139.html