【发布时间】:2014-08-18 16:18:30
【问题描述】:
在Lazy-List 中,我使用此代码并将我的图像存储在名为LazyList 的文件夹中
ImageLoader imageLoader=new ImageLoader(context);
imageLoader.DisplayImage(url, imageView);
但是在Universal-Image-Loader我用这个
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
.build();
ImageLoader.getInstance().init(config);
img = (ImageView) this.findViewById(R.id.test_id);
ImageLoader imageLoader = ImageLoader.getInstance();
imageLoader.displayImage(URL.RECIPE_IMG_URL,img);
但每次它使用互联网获取图像并且没有将我的图像存储在任何文件夹中时,我也将.diskCache(new UnlimitedDiscCache(new File("myFolder"))) 添加到config
但myFolder 中没有任何内容。有什么想法吗?
【问题讨论】:
-
new File("myFolder")这不是您的应用可以访问的位置。你可能想使用context.getCacheDir()。 -
先使用
context.getCacheDir(),然后再改成其他东西,但没有任何改变
标签: android android-imageview android-image universal-image-loader android-lazyadapter