4

I want to display only those images that were loaded into cache memory once we downloaded from url using Universal Image Loader

Example

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..

Is is possible to get the list of only those images from cache Memory??

How can we restrict ViewPager from other blank pages?

I have successfully implemented Universal Image Loader, but got stuck on these issues.

Any idea/suggestion/sample would be appreciated..

Thanks

moDev
  • 5,248
  • 4
  • 33
  • 63

1 Answers1

8

You can define whether image was cached on disc using disc cache:

File cachedImage = imageLoader.getDiscCache().get(imageUrl);
if (cachedImage.exists()) {
    /// image is cached
}

You can check every image URL, define which images are cached and configure ViewPager appropriately.

nostra13
  • 12,377
  • 3
  • 33
  • 43
  • How to set wallpaper using ViewPager? I am unable to get view of pager to set in bitmap @NOSTRA – moDev Dec 30 '12 at 15:21
  • This is completely other question. And I don't know the answer for wallpapers. About ViewPager - http://stackoverflow.com/a/8638772/913762 – nostra13 Dec 30 '12 at 19:22