Android picasso cache images

2019-06-22 08:16发布

In documentation in written that picasso caches images downloaded , but i havent seen an example how to call that image again from cache.

Here i first time load the image :

Picasso.with(getActivity())
        .load(thirdArticle.getImageURL())
        .resize(200, 150)
        .centerCrop()
        .into(mainThreeArticleImage);

Second time when i call same code above it shouldnt get from cache ???

If not, how to call cached images by that url ??

1条回答
时光不老,我们不散
2楼-- · 2019-06-22 08:59

Picasso automatically caches the loaded images, So that next time they will be loaded from the cache. You can check whether the image is loaded from the web, cache or disk by enabling the indicator

setIndicatorsEnabled(true)

enter image description here

Indicators will be shown for each image, specifying where the image is loaded from.
I got the reference from here

查看更多
登录 后发表回答