我正在使用 picasso + okhttp 来加载和缓存图像。
目前这段代码正在按我预期的方式工作,缓存也在按我希望的方式工作。
Picasso.with(Context).load("http://images.com/image.png").into(ImageView);
我想在初始同步时下载图片,所以我尝试了这段代码:
Picasso.with(Context).load("http://images.com/image.png");
但它不起作用。请求(来自 okhttp 库)是在函数 into(ImageView) 中发出的.
我如何缓存图像以便稍后在 Picasso 或 okhttp 中使用它?
谢谢
最佳答案
为了将来引用,我解决了这个问题:
Picasso.with(Context).load("http://images.com/image.png").fetch();
关于android - 使用 picasso + okhttp 缓存图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25056394/