小编典典

从 url 加载图片

all

我有一个图片网址。我想在 ImageView 中显示来自这个 URL 的图像,但我无法做到这一点。

如何做到这一点?


阅读 150

收藏
2022-08-29

共1个答案

小编典典

URL url = new URL("http://image10.bizrate-images.com/resize?sq=60&uid=2216744464");
Bitmap bmp = BitmapFactory.decodeStream(url.openConnection().getInputStream());
imageView.setImageBitmap(bmp);
2022-08-29