android delete some pictures from cache Picasso

798 views Asked by At

I am using Picasso to save a collection of pictures for offline viewing. Later I need to remove some pictures manually from the cache. I can delete all files from folder, but I don't need this. I need to delete 2 or 3 files from the cache. invalidate doesn't work for me. Can anyone help me?

1

There are 1 answers

0
Kartheek On

You can clear in-memory cache in Picasso only per image:

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

Removing all cache is somewhat tricky and described here.

File cache is delegated to HTTP Client, so it's not possible to clear it from Picasso. For more information refer this answer.