title: Unable to display image on Android using imageview
body: <p>I have gone through every tutorial to display an image on an android phone from a URL. I am trying to bind an imageview object to the HTTP url but I keep getting a unable to inflate imageview class error:</p>
  
  <blockquote>
    <p>02-16 23:32:50.204: E/AndroidRuntime(499): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.DBResults/com.DBResults.ContactView}: android.view.InflateException: Binary XML file line #82: Error inflating class Imageview</p>
  </blockquote>
  
  <p>Theo code in my java file:</p>
  
  <pre><code> ....
   setContentView(R.layout.contact_view);
   ImageView imageView = (ImageView)findViewById(R.id.ImageView1); 
   imageView.setImageDrawable(createDrawableFromURL("http://savagelook.com/misc/sl_drop2.png"));
   ....
   private Drawable createDrawableFromURL(String urlString) {
      Drawable image = null;
  try {
      URL url = new URL(urlString);
      InputStream is = (InputStream)url.getContent();
      image = Drawable.createFromStream(is, "src");
  } catch (MalformedURLException e) {
      // handle URL exception
      image = null;
  } catch (IOException e) {
      // handle InputStream exception
      image = null;
  }
  
  return image;
  }
  </code></pre>
  
  <p>My XML file looks like this (line 82 is the opening imageview tag):</p>
  
  <pre><code>&lt;LinearLayout android:orientation="horizontal"
      android:layout_width="fill_parent" android:layout_height="wrap_content"
      android:gravity="left" android:background="@drawable/white"&gt;
      &lt;Imageview  android:id="@+id/ImageView1" 
                  android:layout_height="wrap_content" 
                  android:layout_width="fill_parent" /&gt; 
       &lt;/LinearLayout&gt;
  </code></pre>