title: class cast exception while loading image from the url in android
body: <p>I'm using dynamic table layout, in that there is image, and textview. The data is coming from an XML document. What I want is that in table the layout at runtime, I have to get the parsed image and textview. I am getting the textview correctly but not the image. I used the method <code>LoadImageFromWebOperations</code> for loading the image, but it gets a class cast exception and error like this:</p>
  
  <pre><code>org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl$LimitedInputStream
  </code></pre>
  
  <p>What could be causing the exception?</p>
  
  <p><em>EDIT code from comment</em></p>
  
  <pre><code>private Drawable LoadImageFromWebOperations(String friend_image) { 
    try { 
           System.out.println("friend_image "+friend_image); 
           InputStream is = (InputStream) new URL(friend_image).getContent(); 
           Drawable d = Drawable.createFromStream(is, "src name"); 
            return d; 
           } catch (Exception e) { 
              System.out.println("Exc at oadImageFromWebOperations "+e);
             return null;
         } 
   } 
  </code></pre>