Load images from disk cache with Picasso if offline

前端 未结 5 1764
轮回少年
轮回少年 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:26

    Do this:

    Picasso.with(this)
                .load(url)
                .networkPolicy(NetworkPolicy.OFFLINE)
                .into(imageView);
    

    Also check my previous answer, maybe will help you: Invalidate cache in Picasso

提交回复
热议问题