Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clearing Picasso images cache

I am using the Picasso library on my Android app to load images. I would like to add an option called "Clear images cache" on my app that would remove all the downloaded images from the cache, but obviously that would remove the downloaded images from my app only (I mean not from the other apps).

Is there a simple way to do that using Picasso? Using a native component?

Thanks!

like image 568
thomaus Avatar asked Mar 05 '15 17:03

thomaus


1 Answers

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.

like image 98
Ayzen Avatar answered Sep 21 '22 05:09

Ayzen