Reputation: 1609
Using Picasso to load image from one particular URL, but always showing old image, not the new one
Picasso.get()
.load("https://blabla.com/image/rose.png")
.networkPolicy(NetworkPolicy.NO_CACHE, NetworkPolicy.NO_STORE)
.into(image_view)
dependency
implementation 'com.squareup.picasso:picasso:2.71828'
Upvotes: 0
Views: 465
Reputation: 372
Heyy,
So you have to just put these lines
Picasso.with(context).load(imageUrl)
.error(R.drawable.error)
.placeholder(R.drawable.placeholder)
.memoryPolicy(MemoryPolicy.NO_CACHE, MemoryPolicy.NO_STORE)
.into(imageView);
Edit
Add .stableKey(url) in picasso
And then when loading the image again call this method
Picasso.with(getContext()).invalidate(url);
And that's done
Upvotes: 1