网上有很多关于android异步加载图片的文章,这些文章主要实现了加载图片功能,但没有做图片等的缓存操作,易发生一些不可预知的错误,现在先辈们已经做好了一个关于android异步加载图片的架包,使用方法如下

android网络图片异步加载(使用架包)

FinalBitmap fb=FinalBitmap.create(this);//this为contextfb.display(imageView, uri);

架包下载地址:http://pan.baidu.com/s/1eQ9SRV8

如果需要添加加载和加载失败的默认图片时

public BitmapDisplayConfig config;config = new BitmapDisplayConfig();Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.defaultimg);config.setLoadingBitmap(bitmap);//加载时的图片config.setLoadfailBitmap(bitmap);//加载失败时的图片config.setAnimationType(BitmapDisplayConfig.AnimationType.fadeIn);config.setAnimation(null);config.setBitmapWidth(220);config.setBitmapHeight(320);fb.display(playrecord_img, playRecordList.get(j).getVideoImgUrl(), config);//调用的是重载方法

更多相关文章

  1. Android加载Gif和ImageView的通用解决方案:android-gif-drawable:G
  2. android实现自定义相机以及图片的水印
  3. Android使用BitmapFactory.Options解决加载大图片内存溢出问题
  4. android的selector背景选择器
  5. Android中几种图像特效处理
  6. Android进程注入
  7. android热修复技术 HotFix
  8. Android应用程序资源——Drawable资源概述
  9. 浅谈android的selector背景选择器

随机推荐

  1. 源码编译Android 4.1.2的Camera应用(Andr
  2. Android的用户界面
  3. Android(安卓)解决多个Fragment切换时不
  4. [Traceview]android性能测试
  5. 在Android Sudio中使用Uiautomator
  6. Android开发(二十九)——layout_weight的含
  7. Android(安卓)Socket编程
  8. Android之创建程序快捷方式
  9. Android中文翻译组
  10. AndroidManifest.xml配置文件详解