title: How to load a image into dynamically created imageview from a URL in android?
body: <p>I have dynamically created imageview in my app. I tried to load images from URL. But it does not working. I have tried with many methods, and my currently used code is</p>
  
  <pre><code> try {
              Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL("http://java.sogeti.nl/JavaBlog/wp-content/uploads/2009/04/android_icon_256.png").getContent());
              img.setImageBitmap(bitmap);
          } catch (MalformedURLException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
  </code></pre>
  
  <p>But image is not loaded. What is mistake?</p>