Android的离子高速缓存刷新 [英] Android Ion Cache Refresh
问题描述
我使用一个特定网址在线获得的图像,但是网址本身每隔几分钟自动更改。
我使用ION库从这里
我遇到的问题是,当我刷新页面,页面本身看起来是令人耳目一新,但完全相同的画面出现。
我假设其缓存的形象?如果我重新安装应用程序,然后重新获得正确的图像。
I'm using a specific url to obtain an image online, but the url itself automatically changes every few minutes. I'm using ION library from Here The problem I'm having is when I refresh the page, the page itself looks like it is refreshing but the exact same picture is appearing. I'm assuming its a cached image? If I reinstall the application, then it obtains the correct image again.
这是我如何使用ION在哪里imageID2 [位置]仅仅是一个典型的网址为JPG。
This is how I'm using ION where imageID2[position] is just a typical url to a jpg.
Ion.with(imageView)
.placeholder(R.drawable.ic_launcher)
.error(R.drawable.ic_launcher)
.load(imageId2[position]);
反正我有可以禁用缓存或只是使它再次refind图像?
Is there anyway I can disable the cache or just make it refind the images again?
推荐答案
您可以一个唯一的字符串追加到您的网址,例如当前时间戳,以迫使离子治疗为唯一每个请求。
You can append a unique string to your url for example a current timestamp in order to force Ion to treat each request as unique.
这篇关于Android的离子高速缓存刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!