ImageView简单加载网络图片实例代码
发布时间:2016-12-28 来源:查字典编辑
摘要:复制代码代码如下:privatevoidloadImage(){mImageView=(ImageView)findViewById(R.i...
复制代码 代码如下:
private void loadImage() {
mImageView = (ImageView) findViewById(R.id.imageView);
try {
URL url = new URL("http://images.csdn.net/20130609/zhuanti.jpg");
mImageView.setImageBitmap(BitmapFactory.decodeStream(url.openStream()));
} catch (Exception e) {
}
}