Load image from url

前端 未结 16 1992
独厮守ぢ
独厮守ぢ 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:26

    Try this:

    InputStream input = contentResolver.openInputStream(httpuri);
    Bitmap b = BitmapFactory.decodeStream(input, null, options);
    

提交回复
热议问题