chrisbanes / Android-BitmapCache

Android-BitmapCache is a specialised cache, for use with Android Bitmap objects.
834 stars 224 forks source link

Need a way to purge the DiskCache. #35

Open bkhall opened 11 years ago

bkhall commented 11 years ago

Add the following method to the BitmapLruCache class:

public void purgeDiskCache() {
    try {
        mDiskCache.delete();
    } catch (IOException ex) {
        ex.printStackTrace();
    }
}
ertanden commented 11 years ago

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.