Monday, March 19, 2012

Load image from Link

Load image from link to ImageView.

Bitmap bitmap = BitmapFactory
    .decodeStream((InputStream) new URL(
      "http://www.diwaliwallpapers.com/images/wmwallpapers/Bhagwan-Swaminarayan-1.jpeg")
      .getContent());
    
    img.setImageBitmap(bitmap);
// where img is ImageView


Don't Forgot to add permission in manifest file like this

<uses-permission android:name="android.permission.INTERNET" />

No comments: