多语言展示
当前在线:560今日阅读:145今日分享:43

androidHttp下载网上图片

HttpClient hc=new HttpClient();客户端HttpGet hg=new HttpGet('http://csdnimg.cn/www/images/csdnindex_logo.gif');获得http的对象(相当于一个请求)HttpResponse hr = hc.execute(hg);//用客户端发送一个请求,得到服务器端的相应。Bitmap bm=BitmapFactory.decodeStream(hr.getEntity().getContent);//用位图工厂的decodeStream从服务器的相应中获得内容,给位图bm
推荐信息