Skip to content Skip to sidebar Skip to footer

Images From Google Api Are Getting Cached And I Need To Figure Out How To Remove Them When The App Closes

I built a recyclerview that gets data from Google places api and displays it. I didn't notice that the photos are being cached every time I open the app. According to google, that

Solution 1:

Picasso automatically caches the loaded images, So that next time they will be loaded from the cache.

In order to skip image caching use this :

Picasso.with(context).load(imageUrl)
            .error(R.drawable.error)
            .placeholder(R.drawable.placeholder)
            .memoryPolicy(MemoryPolicy.NO_CACHE, MemoryPolicy.NO_STORE) // prevents caching.into(imageView);

Hope this helps!

Post a Comment for "Images From Google Api Are Getting Cached And I Need To Figure Out How To Remove Them When The App Closes"