简体   繁体   中英

Android picasso cache images

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 ??

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)

在此输入图像描述

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM