SmartImageVIew,我想强制刷新(而不是缓存) [英] SmartImageVIew, I would like to force refresh (and not caching)

查看:173
本文介绍了SmartImageVIew,我想强制刷新(而不是缓存)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用这个有用的类,允许智能在线下载图像(来自loopj家伙)。
它工作正常,但我无法在服务器中可能已更改的同名图像的情况下强制刷新(例如:我更新我的个人资料图片)。
所以目前我在setImageUrl()之前强制删除我的app cache dir。
它有效,并引发了一些FileNotFoundException。没什么大不了的,但我讨厌没有真正工作的东西,我不知道你是否知道我的意思:)
很多谢谢,再次

I am using this useful class that allow smart online downloading of images (from the loopj guys). It works fine, but i cannot force the "refresh" in the case of same name images that could have been changed in the server (example: I update my profile picture). So at the moment I am forcing the brutal delete of my app cache dir before the setImageUrl(). It works, and some FileNotFoundException is raised. No big deal, but I hate having something that works "without really working", I don't know if you know what I mean :) Lots of thanks, again

推荐答案

查看我对类似问题的回答此处

Have a look at my answer to a similar question here

它主要涉及在您用于获取图像的URL的末尾附加一个参数,并确保每次调用该参数时该参数都是唯一的,从而强制进行新的调用。

It essentially involves appending a paramater to the end of the url you use to fetch the image and ensuring that the parameter is unique each time you call it thus forcing a fresh call.

这篇关于SmartImageVIew,我想强制刷新(而不是缓存)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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