You haven't defined default caching options in DisplayImageOption
.
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this)
.threadPoolSize(5)
.threadPriority(Thread.MIN_PRIORITY + 3)
.denyCacheImageMultipleSizesInMemory()
// 1MB=1048576
.memoryCacheSize(1048576 * 5)
.discCache(new UnlimitedDiscCache(cacheDir))
.build();
Here, cacheDir
is a directory may be on SD card
( requires permission "android.permission.WRITE_EXTERNAL_STORAGE" )
or application's cache
directory.
I have provided cacheDirectory
in my application.
File cacheDir = new File(this.getCacheDir(), "name of directory");
if (!cacheDir.exists())
cacheDir.mkdir();
Now, provide your configuration to ImageLoader
by following code before downloading any image,
imageLoader.init(config);