tags:

views:

224

answers:

1

I'm wondering how would I make an image that is located at a specific URL equal to an ImageView's image?

+2  A: 

To download an image and set it as content for an imageview

try {
  ImageView i = (ImageView)findViewbyId(R.id.image);
  Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL(imageUrl).getContent());
  i.setImageBitmap(bitmap); 
} catch (MalformedURLException e) {
  e.printStackTrace();
} catch (IOException e) {
  e.printStackTrace();
}
primalpop