File file = imageLoader.getDiscCache().get(url);
if (!file.exists()) {
DisplayImageOptions options = new DisplayImageOptions.Builder()
.cacheOnDisc()
.build();
imageLoader.displayImage(url, imageView, options);
}
else {
imageView.setImageURI(Uri.parse(file.getAbsolutePath()));
}
Keeping track of my discoveries and sharing information for those who need it.
Tuesday, November 26, 2013
Access Cache file on Universal Image Loader
Sometimes, when using the Universal Image Loader library, there comes a time where the loader takes a while to verify whether the remote image has been already loaded in your cache. To load the cache file directly, you can use the following method to check whether a local copy of the remote file has already been made:
Subscribe to:
Post Comments (Atom)
This comment has been removed by the author.
ReplyDeletedid you find any efficiency difference with normal loading of image using UIL and the above your implementation , here efficiency means "speed of loading image" and "lag while scrolling " any other from your side
ReplyDelete