Search code examples
androiduniversal-image-loader

Calls overlap each other


When I changed the focus of a ListView about 10 times, then current activity would crash. This condition happened repeatedly. And the log said below:

02-10 17:43:57.260: E/Trace(23192): error opening trace file: No such file or directory (2) 02-10 17:43:57.560: W/ImageLoader(23192): discCache(), discCacheSize() and discCacheFileCount calls overlap each other

And my configuration is:

ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
getApplicationContext())
// .taskExecutor(AsyncTask.THREAD_POOL_EXECUTOR)
// .taskExecutorForCachedImages(AsyncTask.THREAD_POOL_EXECUTOR)
.threadPoolSize(5).threadPriority(Thread.NORM_PRIORITY - 2)
.denyCacheImageMultipleSizesInMemory()
// .memoryCache(new WeakMemoryCache())
.memoryCacheSize(2 * 1024 * 1024)
// .discCache(new UnlimitedDiscCache(cacheDir))
.discCacheSize(10 * 1024 * 1024)
.discCacheFileCount(50)
.enableLogging().build();

Could you tell me why? And How could I correct it?


Solution

  • In the codes of Android-universal-Image-Loader,discCache(), discCacheSize() and discCacheFileCount() have the same function on the execution of the library, You only can call one of them, but two or all of them, or, exceptions will be thrown.