Skip to content

Instantly share code, notes, and snippets.

@bobz
Last active December 12, 2015 10:09
Show Gist options
  • Save bobz/ff1a3f28ac0ead18115c to your computer and use it in GitHub Desktop.
Save bobz/ff1a3f28ac0ead18115c to your computer and use it in GitHub Desktop.
Remove item from ImageLoader cache.
try{
imgLoader.getMemoryCache().evictAll();
imgLoader.destroy();
imageLoader = null;
DiskLruCache diskCache = DiskLruCache.open(cacheDir, 2, 2, maxSize);
Hasher hasher = new Hasher();
String hash = hasher.hash(url);
diskCache.remove(hash);
diskCache.flush();
diskCache.close();
} catch (Exception e){
Log.w(LOG_TAG, "Failed to remove url", e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment