如何使用通用图像装载机的Android来显示ViewPager只缓存图像? [英] How to display only cache memory images in ViewPager using Universal Image Loader Android?
问题描述
我想只显示一次,我们使用来自网址下载了装载到高速缓存存储器映像通用图像装载机
I want to display only those images that were loaded into cache memory once we downloaded from url using Universal Image Loader
的 示例的
Example
我的 15网址以下载 ViewPager
图像和显示器,而是出于他们的只有5人下载和我关闭应用程序..现在我没有任何互联网连接以从网络其他所有的图像,但应用程序将只显示5图像和剩余的页面将是空白的。
I have 15 URLS to download image and display inViewPager
, but out of them only 5 were downloaded and i closed the app.. Now i don't have any internet connection to get all the other images from web, but app will show only 5 images and remaining pages will be blank..
时可以从缓存内存
??
我们怎样才能限制 ViewPager
其他空白页?
How can we restrict ViewPager
from other blank pages?
我已经成功实施通用图像装载机
,但卡住了这些问题。
I have successfully implemented Universal Image Loader
, but got stuck on these issues.
任何想法/建议/样品将AP preciated ..
Any idea/suggestion/sample would be appreciated..
感谢
推荐答案
您可以定义是否图像是使用光盘的高速缓存上盘缓存:
You can define whether image was cached on disc using disc cache:
File cachedImage = imageLoader.getDiscCache().get(imageUrl);
if (cachedImage.exists()) {
/// image is cached
}
您可以检查每个图像的URL,定义哪些图像缓存并适当配置ViewPager。
You can check every image URL, define which images are cached and configure ViewPager appropriately.
这篇关于如何使用通用图像装载机的Android来显示ViewPager只缓存图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!