Android-BitmapCache icon indicating copy to clipboard operation
Android-BitmapCache copied to clipboard

Need a way to purge the DiskCache.

Open bkhall opened this issue 12 years ago • 1 comments

Add the following method to the BitmapLruCache class:

public void purgeDiskCache() {
    try {
        mDiskCache.delete();
    } catch (IOException ex) {
        ex.printStackTrace();
    }
}

bkhall avatar Aug 21 '13 20:08 bkhall

I need something like this too. Actually I would also like to invalidate the memory cache too. This is a very valid use case.

Consider that you are using the cache for thumbnails of videos on the device. Sometimes the video may be edited in-place, so the cache is invalidated. The edit may be done externally, so there should be a method to invalidate all cache entries at once.

ertanden avatar Sep 25 '13 19:09 ertanden