android 显示internet 图片

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 图片

上一篇:健康管理app要注意哪些要点


下一篇:[IOS_UI控件]IPHONE应用开发 - 打开和关闭键盘