Search code examples
javaandroiduniversal-image-loader

Android Universal Image Loader Timeout


I am using Android Universal Image Loader for Downloading Image from an URL.Because My Image Size is large,Image Loader reach 5 second timeout and throw an exception. How can I increase ImageLoader Time out? Also you must know, I found below code but it didn't work because this library hasn't this function.

imageDownloader(new URLConnectionImageDownloader(5 * 1000, 20 * 1000));

my ImageLoaderConfig :

ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context).build();
ImageLoader.getInstance().init(config);

Solution

  • ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
        .imageDownloader(new BaseImageDownloader(context, 5 * 1000, 20 * 1000))
        .build();
    ImageLoader.getInstance().init(config);