-2

I am using universal image loader library for loading the images in my listview. I want to clear the cache for all the images at once.

I know how to do it for one image at a time.

 MemoryCacheUtils.removeFromCache("file://"+path, ImageLoader.getInstance().getMemoryCache());
DiskCacheUtils.removeFromCache("file://"+path, ImageLoader.getInstance().getDiskCache());

How can I do this?

Fahim
  • 12,198
  • 5
  • 39
  • 57

2 Answers2

1

You can do that by:

imageLoader.clearMemoryCache();

or

imageLoader.getDiskCache().clear();

it depends on your configuration.

Gaskoin
  • 2,469
  • 13
  • 22
1

You can clear the memory cache and the disk cache distinctly. For each just call:

ImageLoader.getInstance().clearMemoryCache();
ImageLoader.getInstance().clearDiskCache();

It will erase all stored cache data.

Tiago GouvĂȘa
  • 15,036
  • 4
  • 75
  • 81