Load image from url

前端 未结 16 2204
独厮守ぢ
独厮守ぢ 2020-11-22 05:12

I have an image URL. I want to display an image from this URL in an ImageView but I am unable to do that.

How can this be achieved?

16条回答
  •  梦如初夏
    2020-11-22 05:27

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

提交回复
热议问题