title: android imageview from url problem
body: <p>I am using the following code to display images from an url in my imageview:</p>
  
  <pre><code>private Drawable LoadImageFromWebOperations(String url)
  {
      try
      {
          InputStream is = (InputStream) new URL(url).getContent();
          Drawable d = Drawable.createFromStream(is, "src name");
          return d;
      }
      catch (Exception e) 
      {
           return null;
      }
  }
  
  
  Drawable drawable = LoadImageFromWebOperations("http://www.androidpeople.com/wp-content/uploads/2010/03/android.png");
  imgView.setImageDrawable(drawable);
  </code></pre>
  
  <p>I have a timer that changes the image every 5th second. But in some rare cases the app freezes. Is it because the LoadImageFromWebOperations fails to load the image? Or any ideas what the problem might be, and how to fix it? Thanks!</p>