我想检查图像 url 是否包含在缓存中。我正在使用 Picasso
图像加载器。
这是我的代码
new Picasso.Builder(this).downloader(new OkHttpDownloader(client)).build();
现在 Picasso.getCache()
没有 get(key)
。
虽然 Cache
类在内部使用 LRUDiskCache 但它的 private
有什么想法吗??
最佳答案
Jake 已经在 Twitter ( https://twitter.com/JakeWharton/status/679403330809028608 ) 上回答了这个问题,但我在这里重新发布答案以提高可见性。
You could make a request with a network policy of
OFFLINE
and if it fails then the image is not in the disk cache.
关于android - 检查缓存 picasso 中是否存在图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34417976/