Android
Android

Reputation: 1609

Picasso always showing old image not the new one from one particular URL

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

Answers (2)

Harsh0021
Harsh0021

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

Hex Hex Hex
Hex Hex Hex

Reputation: 66

You have to add .memoryPolicy(MemoryPolicy.NO_CACHE)

Upvotes: 1

Related Questions