Load images from disk cache with Picasso if offline

前端 未结 5 1741
轮回少年
轮回少年 2020-11-30 04:50

I have some images that I download from different web sites when the app starts, by doing this:

Picasso.with(context).load(image_url).fetch();
5条回答
  •  攒了一身酷
    2020-11-30 05:41

    Is OkHttp and Okio present on the class path? (or in your dependencies) Because by default Picasso lets the HttpClient handle the caching (it does not do this by default)

    You have 2 options

    • include the mentioned dependencies (recommended)
    • specify the cache manually

提交回复
热议问题