加载网络图片
2015-10-29 20:07
591 查看
加载网络图片的方式
http://www.it165.net/pro/html/201404/12299.htmlhttp://www.it165.net/pro/ydad/
volley
RequestQueue queue= Volley.newRequestQueue(MainActivity.this); ImageRequest imageRequest=new ImageRequest("http://p7.qhimg.com/dmt/235_165_/t0157e09f0e6a1b24eb.jpg", new Response.Listener<Bitmap>() { //0,,0是图片的透明度 @Override public void onResponse(Bitmap response) { imageView.setImageBitmap(response); } }, 0,0, Bitmap.Config.RGB_565, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { } }); queue.add(imageRequest);
imageloader加载图片
RequestQueue queue= Volley.newRequestQueue(MainActivity.this); ImageLoader imageLoader=new ImageLoader(queue, new ImageLoader.ImageCache() { @Override public Bitmap getBitmap(String url) { return null; } @Override public void putBitmap(String url, Bitmap bitmap) { } }); ImageLoader.ImageListener imageListener= ImageLoader.getImageListener(imageView,R.mipmap.ic_launcher,R.mipmap.ic_launcher); imageLoader.get("http://p7.qhimg.com/dmt/235_165_/t0157e09f0e6a1b24eb.jpg",imageListener);
相关文章推荐
- 径向基函数(RBF)神经网络
- HTTP的请求和响应总结
- 如何使用SOCKET 发送HTTP1.1 GET POST请求包
- iPhone开发 判断当前的网络是3g还是wifi
- HTTP请求头的具体内容解释
- 类模版的分离编译问题 http://blog.csdn.net/woshishuizzz/article/details/8648440
- Dinic 算法求最大流(最小割) POJ 2536
- HTTP协议详解
- Oracle 修改http端口
- 删除 https://tfs.visualstudio.com上的项目
- (十) HTTP/2的消息交换
- javaweb实现自动将前端的属性值(HttpServletRequest)转化为后台对应的实体类
- 解决SQL Server Always 日志增大的问题-摘自网络
- httpclient用法
- 三公网络监督平台APP上线,源代码出售。
- 在没有网络的情况下用安卓手机和数据线让台式电脑上网
- C# 中使用WebClient 请求 https
- 第七章 设计程序架构 之 设计HTTP模块和处理程序
- codeforce 589F(二分 +(贪心 or 网络流))
- angular 采用$http 上传file spring 提示找不到boundary