我有一个图像视图列表,其中某些视图将经常使用固定的URL进行更新。通过在URL末尾添加时间戳查询参数。它可以工作,但我发现当它更新时,它也会清除当前内容。是否有任何方法可以防止这种情况发生?
// the one needed to update with timestamp appended
image += "?"+String.valueOf(System.currentTimeMillis());
Glide.with(mContext.getApplicationContext())
.load(image)
.error(R.drawable.default_avatar)
.centerCrop()
.crossFade()
.into(((VideoViewHolder) holder).img);
// the others don't need to update
Glide.with(mContext.getApplicationContext())
.load(image)
.error(R.drawable.default_avatar)
.centerCrop()
.crossFade()
.into(((VideoViewHolder) holder).img);
请注意,没有时间戳附加的其他内容都是良好的。