DisplayImageOptions imageOptions = new DisplayImageOptions.Builder()
.cacheOnDisk(true).cacheInMemory(true)
.showImageOnLoading(R.drawable.ic_launcher)
.showImageOnFail(R.drawable.ic_launcher).build();
int max = (int) (Runtime.getRuntime().maxMemory() / 8);
ImageLoaderConfiguration configuration = new ImageLoaderConfiguration.Builder(
getApplicationContext())
.discCache(new UnlimitedDiskCache(getCacheDir()))
.memoryCache(new UsingFreqLimitedMemoryCache(max))
.threadPoolSize(3).threadPriority(Thread.NORM_PRIORITY - 1)
.defaultDisplayImageOptions(imageOptions).build();
ImageLoader.getInstance().init(configuration);
ImageLoader加载图片
最新推荐文章于 2022-08-20 21:52:25 发布