Search code examples
androidjsoncachingimageviewpicasso

Android, Image Cache is not clearing in Picasso


I'm using the following code to load an image from Json into an imageView.

Picasso.with(Sell_Preview_Activity.this)
                .load(Httppost_Links.imagePath
                        + ConstantVariables.sellDetails_stringURL)
                .resize(size, size).centerInside()
                .memoryPolicy(MemoryPolicy.NO_CACHE)
                .into(viewImage_imageView);

But still the cache is maintained even after the image has been edited. Can anyone please help me how I can overcome this issue.


Solution

  • May be you can use new method of picasso

    Picasso.with(getActivity()).invalidate(file);
    

    or else same as memorypolicy add networkpolicy

    .networkPolicy(NetworkPolicy.NO_CACHE)