滑动不更新相同网址的图像android? [英] Glide not updating image android of same url?

查看:115
本文介绍了滑动不更新相同网址的图像android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为图片提供了相同的网址。当我多次更新此图像时,它会显示上一张图像。服务器上的图像和图片版本已更新,但Glide未显示新图像。我希望每次都能获取新图像并将其缓存。

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);

我可以通过改变互联网来重现这个错误,在一个互联网上它的变化图像在其他互联网上如预期的那样在2或3次尝试更改图像后保持相同

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

推荐答案

//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);

这篇关于滑动不更新相同网址的图像android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆