Android : Flush Universal Image Loader cache

on Tuesday, April 14, 2015


I'm using a volley singleton to load images



private VolleySingleton(){
mRequestQueue = Volley.newRequestQueue(VolleyApplication.getAppContext());

mImageLoader = new ImageLoader(this.mRequestQueue, new ImageLoader.ImageCache() {
private final LruCache<String, Bitmap> mCache = new LruCache<String, Bitmap>(10);
public void putBitmap(String url, Bitmap bitmap) {
mCache.put(url, bitmap);
}
public Bitmap getBitmap(String url) {
return mCache.get(url);
}
});
}


I need to flush the cache to update the imageView when the photo is changed.


I've read about MemoryCacheUtils here but can't seem to implment it in my code, can I use MemoryCacheUtils in my code? if not is there a way to flush the cache in my imageLoader?


0 comments:

Post a Comment