Clear BitMap Cache - Ion Ion

I would like to clear the cache, but I'm not sure how to clear the bitmap. I use the Koush Ion library to upload an image

try {
            bitmap = Ion.with(context).load(URLimage).withBitmap().asBitmap().get();
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (ExecutionException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

I need to clear the bitmap cache every time I press a button. thanks in advance

+4
source share
2 answers

Use Ion.getDefault(context).getCache().clear()to clear the file cache.

Use Ion.getDefault(context).getBitmapCache().clear()to clear the cache in memory.

. : https://github.com/koush/AndroidAsync/blob/master/AndroidAsync/src/com/koushikdutta/async/util/FileCache.java#L292 https://github.com/koush/ion/blob/master/ion/src/com/koushikdutta/ion/bitmap/IonBitmapCache.java#L63

Ion.dump() . . .

+4

, , ;

Ion.getDefault().configure(). GetResponseCache(). ()

+1

All Articles