码迷,mamicode.com
首页 > 移动开发 > 详细

android 显示internet 图片

时间:2014-06-16 06:16:39      阅读:333      评论:0      收藏:0      [点我收藏+]

标签:des   android   code   http   ext   get   

try {

HttpGet httpRequest = new HttpGet(edtUrl.getText()
.toString());
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = (HttpResponse) httpclient
.execute(httpRequest);
HttpEntity entity = response.getEntity();
BufferedHttpEntity bufferedHttpEntity = new BufferedHttpEntity(
entity);
InputStream is = bufferedHttpEntity.getContent();
Bitmap bitmap = BitmapFactory.decodeStream(is);

ImageView iv = (ImageView) MainActivity.this
.findViewById(R.id.imageView1);

iv.setImageBitmap(bitmap);

} catch (Exception e) {
// TODO: handle exception
}

android 显示internet 图片,布布扣,bubuko.com

android 显示internet 图片

标签:des   android   code   http   ext   get   

原文地址:http://www.cnblogs.com/honeynm/p/3784010.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!