How to get image from url website in imageview in android

前端 未结 4 1587
一向
一向 2021-01-12 10:19

I am trying to get image in ImageView from url website but the image not show so, What is the wrong in this code? This is the url of the image.

It is my Main Activi

4条回答
  •  深忆病人
    2021-01-12 10:59

    If you're going to be loading multiple images from URL's in your app, it's definitely worth looking into:

    nostra13's "Universal Image Loader"

    It's an awesome library with tons of features to display images from URLs, cast to bitmaps, etc.

    Once you've included the class and declared the imageloader + imageloader configuration, its a simple as this:

    imageLoader.displayImage("http://www.yoursite.com/my_picture.png", imageView);
    

    Where imageView is the imageView you would like the image to appear in.

提交回复
热议问题