문제

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?

도움이 되었습니까?

해결책 2

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.

다른 팁

I was told somewhere that methods, discCacheSize() and discCacheFileCount(), couldn't be called simultaneously. The link is here: https://github.com/nostra13/Android-Universal-Image-Loader/issues/532 I hope this will help you.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top