ImageLoader缓存机制
来源:互联网 发布:万网域名端口映射 编辑:程序博客网 时间:2024/06/07 07:02
//一个Utils类
private DisplayImageOptions options;public ImageLoaderPicture(Context context) { ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context).threadPriority(Thread.NORM_PRIORITY - 2) .denyCacheImageMultipleSizesInMemory() .discCacheFileNameGenerator(new Md5FileNameGenerator()) .tasksProcessingOrder(QueueProcessingType.LIFO) .memoryCache(new WeakMemoryCache()) .build(); ImageLoader.getInstance().init(config); options = new DisplayImageOptions.Builder() .showStubImage(0) .showImageForEmptyUri(0) .showImageOnFail(0) .cacheInMemory().cacheOnDisc() .imageScaleType(ImageScaleType.IN_SAMPLE_INT) .bitmapConfig(android.graphics.Bitmap.Config.RGB_565) .build();}public DisplayImageOptions getOptions() { return options;}public void setOptions(DisplayImageOptions options) { this.options = options;}
//MyApp
public class MyApp extends Application { @Override public void onCreate() { super.onCreate(); ImageLoaderConfiguration configuration=new ImageLoaderConfiguration.Builder(getApplicationContext()).memoryCacheExtraOptions(480,800).build(); ImageLoader.getInstance().init(configuration); }}//使用ImageLoader.getInstance().displayImage(list.get(position).getImage_url(),v.imageView, new ImageLoaderPicture(context).getOptions(),new SimpleImageLoadingListener());
0 0
- imageloader缓存机制
- imageloader缓存机制
- ImageLoader缓存机制
- ImageLoader双缓存机制加载图片
- ImageLoader缓存
- imageLoader缓存
- Imageloader 缓存
- Imageloader缓存
- Android -- ImageLoader本地缓存
- Android -- ImageLoader本地缓存
- Android -- ImageLoader本地缓存
- Android -- ImageLoader本地缓存
- Android -- ImageLoader本地缓存
- Android ImageLoader 本地缓存
- ImageLoader----内存缓存
- ImageLoader硬盘缓存解析
- ImageLoader内存缓存解析
- ImageLoader缓存图片
- java中+=的含义
- Codeforces Round #402 (Div2)C题
- ajax 实现页面加载和内容的删除
- web 广告浮动碰到边界回弹
- 我与VB.net再次重逢,最简单的一个小程序
- ImageLoader缓存机制
- 计算机基本配置
- 1412: [ZJOI2009]狼和羊的故事
- 程序设计方法学作业—三天打渔两天晒网程序设计
- 加密解密(字符串处理)
- spring Bean的基本配置
- 一键jquery异步上传文件(图片)的实现(文件上传进度读取未做)
- matlab+opencv混编处理高光谱数据
- 家长如何让孩子健康上网?