Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Glide not updating image android of same url?

I have the same url for an image. When I update this image more than one time it shows the previous image. The image and picture version on the server is updated but Glide is not showing the new image.I want to get new image every time and cache it .

Glide.with(context)         .load(Constants.COPY_LINK_BASE_URL + info.getDisplayPicture())         .placeholder(R.drawable.ic_profile).dontAnimate()         .diskCacheStrategy(DiskCacheStrategy.SOURCE)         .signature(new (SettingManager.getUserPictureVersion(context)))         .into(ivUserProfilePhoto); 

I can reproduce this bug by changing internet ,on one internet its change image as expected on other internet it remain same after 2 or 3 tries to changing image

like image 831
Usman Saeed Avatar asked Jan 20 '17 07:01

Usman Saeed


People also ask

Does glide cache images Android?

Glide enables effective loading and caching of images. You can load images from a variety of sources such as files URIs, Android resources, bitmaps, drawables, etc. Just use the load() method to receive images.


1 Answers

//Use bellow code, it work for me.Set skip Memory Cache to true. it will load the image every time.   Glide.with(Activity.this) .load(theImagePath) .diskCacheStrategy(DiskCacheStrategy.NONE) .skipMemoryCache(true) .into(myImageViewPhoto); 
like image 70
jessica Avatar answered Oct 05 '22 19:10

jessica