Reputation: 189
I want to check if image url is contained inside cache. I am using Picasso
image loader .
this is my code
new Picasso.Builder(this).downloader(new OkHttpDownloader(client)).build();
now Picasso.getCache()
does not have get(key)
.
though Cache
class internally uses LRUDiskCache but its private
Any ideas??
Upvotes: 17
Views: 4338
Reputation: 8574
Jake already answered this on Twitter (https://twitter.com/JakeWharton/status/679403330809028608), but I'm reposting the answer here for visibility.
You could make a request with a network policy of
OFFLINE
and if it fails then the image is not in the disk cache.
Upvotes: 14