Check if Image is in Cache - Universal Image Loader

前端 未结 5 1917
醉梦人生
醉梦人生 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 19:08

    Use MemoryCacheUtils.

    MemoryCacheUtils.findCachedBitmapsForImageUri(imageUri, ImageLoader.getInstance().getMemoryCache());
    

    Memory cache can contain several bitmaps (diffenrent sizes) for one image. So memory cache use special keys, not image urls.

提交回复
热议问题