com.xtremelabs.imageutils
Class ImageLoader

java.lang.Object
  extended by com.xtremelabs.imageutils.AbstractImageLoader
      extended by com.xtremelabs.imageutils.ImageLoader

public class ImageLoader
extends AbstractImageLoader

This class simplifies the task of loading images from a URL into an ImageView on Android. HOW TO USE: For use without the support library Every Activity or Fragment that needs images must instantiate its own ImageLoader instance. When used with an Activity, instantiate a new ImageLoader in the Activity's onCreate() method. Make sure you call the ImageLoader's onDestroy method from within the Activity's onDestroy method. When used with a Fragment, instantiate your ImageLoader in the onCreateView() method. Make sure you call the ImageLoader's onDestroy method in the onDestroyView method.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.xtremelabs.imageutils.AbstractImageLoader
AbstractImageLoader.Options
 
Field Summary
 
Fields inherited from class com.xtremelabs.imageutils.AbstractImageLoader
TAG
 
Constructor Summary
ImageLoader(Activity activity)
          Instantiates a new ImageLoader that maps all requests to the provided Activity.
ImageLoader(Fragment fragment)
          Instantiate a new ImageLoader that maps all requests to the provided Fragment.
 
Method Summary
 
Methods inherited from class com.xtremelabs.imageutils.AbstractImageLoader
clearMemCache, destroy, invalidateFileSystemUri, loadImage, loadImage, loadImage, loadImageFromResource, precacheImageToDisk, precacheImageToDisk, precacheImageToDiskAndMemory, precacheImageToDiskAndMemory, setDefaultOptions, setMaximumDiskCacheSize, setMaximumMemCacheSize, setNetworkRequestCreator, stopLoadingImage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageLoader

public ImageLoader(Activity activity)
Instantiates a new ImageLoader that maps all requests to the provided Activity. This should be called from your Activity's onCreate method.

Parameters:
activity - All requests to the ImageLoader will be mapped to this Activity. All references are released when the ImageLoader's onDestroy() method is called.
Throws:
ThreadChecker.CalledFromWrongThreadException - This constructor must be called from the UI thread.

ImageLoader

public ImageLoader(Fragment fragment)
Instantiate a new ImageLoader that maps all requests to the provided Fragment. This should be called from your Fragment's onCreateView method.

Parameters:
fragment - All requests to the ImageLoader will be mapped to this Fragment. All references are released when the ImageLoader's onDestroy() method is called.
Throws:
ThreadChecker.CalledFromWrongThreadException - This constructor must be called from the UI thread.