title: Android Universal ImageLoader in ListView scrolling very slow
body: <p>I have a ListView with items which have various numbers of images. Each item was put into a HorizontalScrollView with a horizontal LinearLayout, and I add ImageViews dynamically into the LinearLayout.</p>
  
  <p>I used <a href="https://github.com/nostra13/Android-Universal-Image-Loader" rel="nofollow">Android-Universal-Image-Loader</a> to load images from local sdcard asynchronously. I set the ImageLoaderConfiguration in the onCreate method of custom Application class:</p>
  
  <pre><code>ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
          .threadPriority(Thread.NORM_PRIORITY - 2)
          .denyCacheImageMultipleSizesInMemory()
          .diskCacheFileNameGenerator(new Md5FileNameGenerator())
          .diskCacheSize(200 * 1024 * 1024) // 200 Mb
          .tasksProcessingOrder(QueueProcessingType.LIFO)
          .writeDebugLogs() // Remove for release app
          .build();
  ImageLoader.getInstance().init(config);
  </code></pre>
  
  <p>And set tha DisplayImageOptions in the constructor method of Adapter class:</p>
  
  <pre><code>options = new DisplayImageOptions.Builder()
          .showImageOnLoading(R.drawable.ic_loading)
          .showImageForEmptyUri(R.drawable.ic_loading_failed)
          .showImageOnFail(R.drawable.ic_loading_failed)
          .cacheInMemory(true)
          .cacheOnDisk(true)
          .considerExifParams(true)
          .build();
  </code></pre>
  
  <p>And I load the images dynamically in the getView method:</p>
  
  <pre><code>ImageLoader.getInstance().displayImage(imageURI, imageView, options);
  </code></pre>
  
  <p>My problem is, when I scroll the ListView, the image will be reloaded very slow, actually about the same speed as the first load. And it seems like each image was loaded from disk again without caching.</p>
  
  <p>PS: My images are mostly taken from camera, and have a size of about 2MB ~ 3MB. I'm not sure whether it's because the original image is too large.</p>
  
  <p>Thanks for your advice!</p>