Universal Image Loader - removing single image from cache not working Universal Image Loader - removing single image from cache not working android android

Universal Image Loader - removing single image from cache not working


What @vanomart answered is perfect, just to update the answer. Currently, UIL supports,

MemoryCacheUtils.removeFromCache(imageUri, imageLoader.getMemoryCache());DiskCacheUtils.removeFromCache(imageUri, imageLoader.getDiskCache());

So, there is better way to clear disk cache.


According to developer of this library is solution quite simple. All you need to do is to delete cached image from memory and also from disk. How to do that is shown below.

File imageFile = imageLoader.getDiscCache().get(imageUri);if (imageFile.exists()) {    imageFile.delete();}MemoryCacheUtils.removeFromCache(imageUri, imageLoader.getMemoryCache());

Snippet above is from this issue.