imageView设置网址图片
myImageView.setImageURI(Uri.parse(http://example.com/logo.png));?
2.try {?
? ? URL thumb_u = new URL("http://www.example.com/image.jpg");?
? ? Drawable thumb_d = Drawable.createFromStream(thumb_u.openStream(), "src");?
? ? myImageView.setImageDrawable(thumb_d);?
}?
catch (Exception e) {?
? ? // handle it?
}?
?
3.
public Bitmap getRemoteImage(final URL aURL) {?
? ? try {?
? ? ? ? final URLConnection conn = aURL.openConnection();?
? ? ? ? conn.connect();?
? ? ? ? final BufferedInputStream bis = new BufferedInputStream(conn.getInputStream());?
? ? ? ? final Bitmap bm = BitmapFactory.decodeStream(bis);?
? ? ? ? bis.close();?
? ? ? ? return bm;?
? ? } catch (IOException e) {}?
? ? return null;?
}?setImageBitmap
既可以了
?