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 downloads the image and stores the full-size image (in my case the image resolution was 1160*750) in the cache and whenever we ask for the same image, it will return the full-size image and resize them to fit into the ImageView in real-time.
Picasso allows for hassle-free image loading in your application—often in one line of code! Picasso. get(). load("https://i.imgur.com/DvpvklR.png").into(imageView);
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With