Clear Picasso Image Cache

I use the Picasso library in my Android application to download images. I would like to add the option "Clear image cache" to the application, which will remove all downloaded images from the cache, but, obviously, this will delete the downloaded images from my application (I mean not from other applications).

Is there an easy way to do this with Picasso? Using your own component?

Thanks!

+8
android caching image picasso
source share
2 answers

You can clear the cache in memory in Picasso just for the image:

Picasso.with(context).invalidate(imagePath); 

Removing the entire cache is somewhat more complicated and is described here .

The file cache is delegated to the HTTP client, so it cannot be deleted from Picasso. For more information, see.

+12
source share

Try this line of code below, this will remove the resource from ImageView.

 Picasso.with(context).setImageResource(0); 
0
source share

All Articles