I load image from URL using picasso
first time on line, After then use from cache. Any URL from web is load in imageview
on line or off line. But my server image URL is load image in on line not in off line. I use below code from image load.
Picasso.with(mContext)
.load(urlProfile)
.networkPolicy(NetworkPolicy.OFFLINE)
.placeholder(R.drawable.ic_place_holder)
.into(imageView, new Callback() {
@Override
public void onSuccess() {
}
@Override
public void onError() {
Picasso.with(mContext)
.load(urlProfile)
.placeholder(R.drawable.ic_place_holder)
.into(imageView);
}
});
Web url load in online or offline both : URL
My server url load image only in online: URL
I show in cache directory and found that image of my server URL is not cached. Any have idea about that.
Hi below is my solutions and it's working perfectlly.
Hope this helps you..
By the way this is very old but you can use Glide for better performance.