Murali Murali - 1 year ago 206
Android Question

How to delete all files from Android Picasso cache

I am working on a project where iam using picasso ( to load all the images in a Recycler View, i wanted to remove all the files from the Picasso cache at the time of logging out of the application.
Can you please help me how to do that, i dont want to invalidate every single file separately, also where does it save all the files?

Answer Source

I myself was searching on how to clear the whole cache few days back and stumbled upon it on Stackoverflow itself, cannot seem to find the thread now but here's my code.

Add this class to the com.squareup.picasso package :

 package com.squareup.picasso;

    public class PicassoTools {

        public static void clearCache (Picasso picasso) {

And simply call this on logout method :

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download