I would like to make an ImageView display an image on a website. So I create a new ImageView and execute imgView.setImageURI(uri);
When I launch the app the
First, you should download the image and save it in your device(sdcard or memory)
.
Then, get its file path, using Uri.parse(filePath)
to convert path to uri
finally, call ImageView
's setImageURI(Uri)
to fullfill.
-- I use this way to achieve my purpose and there is a bug:if the image is to large(maybe exceed 1Mb or so, it may report outOfMemeroy Exception!!!)