How to force a cache clearing using Universal Image Loader Android?

If you are caching it both in memory and disc, for example:

ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())         
        .memoryCache(new UsingFreqLimitedMemoryCache(2 * 1024 * 1024)) 
        .discCache(new UnlimitedDiscCache(cacheDir)) 
.........

Ensure you remove it from both of them, then reload your image view.

MemoryCacheUtils.removeFromCache(url, ImageLoader.getInstance().getMemoryCache());
DiscCacheUtils.removeFromCache(url, ImageLoader.getInstance().getDiscCache());

Leave a Comment