HttpURLConnection connection = (HttpURLConnection) url.openConnection();   connection.setDoInput(true);    connection.connect(); InputStream input = connection.getInputStream(); bitmap[i] = BitmapFactory.decodeStream(input); System.out.println("the bitmap is +bitmap[i]);
SkImageDecoder::Factory returned null the bitmap is null
使用 HttpURlConnection 加载  可能return null
HttpGet httpRequest = new HttpGet(url); HttpClient httpclient = new DefaultHttpClient(); HttpResponse response = (HttpResponse) httpclient           .execute(httpRequest); HttpEntity entity = response.getEntity(); BufferedHttpEntity bufferedHttpEntity = new BufferedHttpEntity(entity); InputStream is = bufferedHttpEntity.getContent(); Drawable d = Drawable.createFromStream(is, "");
就不会发生 这种情况

更多相关文章

  1. android中异步加载图片信息
  2. android UI控件之webview控件使用实例:加载网页到webview中
  3. android ImageLoader加载本地图片的工具类
  4. Android WebView加载https网页(亲测)
  5. Android中的GridView图片异步加载
  6. Android 加载图片传到另一个页面 关于回调
  7. Android ListView 滚动加载数据
  8. Android 加载图片文件 函数
  9. android中listview分批加载数据

随机推荐

  1. 一个c语言源程序是由什么组成
  2. c语言多行注释符号是什么
  3. c语言程序的基本结构是什么
  4. 一个c语言程序只能有一个主函数吗
  5. 为什么要学习C语言
  6. devc不能编译运行怎么办
  7. c语言自学要多久?
  8. c语言中的注释符号是什么
  9. c语言的标识符允许使用关键字吗?
  10. c语言函数类型有几种