Check if Image is in Cache - Universal Image Loader

前端 未结 5 1916
醉梦人生
醉梦人生 2021-02-07 18:29

I guess the title says it all. I tried:

imageLoader.getMemoryCache().get(key); 

with the image uri as key, but it always return null

5条回答
  •  野的像风
    2021-02-07 18:59

    For disk cache use below code

    public static boolean isDiskCache(String url) {
            File file = DiskCacheUtils.findInCache(url, ImageLoader.getInstance().getDiskCache());
            return file != null;
    }
    

提交回复
热议问题