title: Android Drawable Images from URL
body: <p>I am presently using the following piece of code to load in images as drawable objects form a URL.</p>
  
  <pre><code>Drawable drawable_from_url(String url, String src_name) 
  throws java.net.MalformedURLException, java.io.IOException {
          return Drawable.createFromStream(((java.io.InputStream)new java.net.URL(url).getContent()), src_name);
  
  }
  </code></pre>
  
  <p>This code works exactly as wanted, but there appears to be compatibility problems with it. In version 1.5, it throws a <code>FileNotFoundException</code> when I give it a URL. In 2.2, given the exact same URL, it works fine. The following URL is a sample input I am giving this function.</p>
  
  <pre><code>http://bks6.books.google.com/books?id=aH7BPTrwNXUC&amp;printsec=frontcover&amp;img=1&amp;zoom=5&amp;edge=curl&amp;sig=ACfU3U2aQRnAX2o2ny2xFC1GmVn22almpg
  </code></pre>
  
  <p>How would I load in images in a way that is compatible across the board from a URL?</p>