I am using Picasso
to load image in my application but i facing a issue that my image URL
is same but image is changing from backend
calling the same URL but Picasso
loading the same image saved in its cache. Now i want to clear the cache for that Image and reload the image again.
What i have tried i searched on SO find that we can use picasso.invalidate(fileName);
or memoryPolicy(MemoryPolicy.NO_CACHE)
but i am getting the error message in code
Can't reslove method invalidate
Can't reslove method memoryPolicy
dependency for picasso in gradle :
compile 'com.squareup.picasso:picasso:2.4.0'
Try to use this.
Picasso.with(context).invalidate(url);
Picasso.with(context).load(url).networkPolicy(NetworkPolicy.NO_CACHE).memoryPolicy(MemoryPolicy.NO_CACHE);
compile 'com.squareup.picasso:picasso:2.5.2'
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