title: Issue loading ImageView from InputStream obtained from web service in Android 3.0 and above
body: <p>My app has to display an image preview from the image data obtained as InputStream from a web service. InputStream is decoded to Bitmap to display in ImageView. This entire flow is working fine in Android 2.2 and 2.3, whereas it's not functioning with Android 3.0 and 4.0. The bitmap decoded is null in the latter case whereas its fine in 2.x.</p>
  
  <p>Here is the code snippet I use..</p>
  
  <pre><code>ImageView imgView = (ImageView) findViewById(R.id.image);       
  String imageUrl = "my webservice url";      
  HttpClient httpClient = new DefaultHttpClient();
  HttpGet mHttpGetEntity = new HttpGet(imageUrl);
  HttpResponse response;
  try {
      response = httpClient.execute(mHttpGetEntity);
      XmlPullParser xpp = XmlPullParserFactory.newInstance().newPullParser();       
      InputStream is = response.getEntity().getContent();
      xpp.setInput(is, "UTF-8");
      // use xpp for process
      imgView.setImageBitmap(BitmapFactory.decodeStream(is));        
  } catch (ClientProtocolException e) {
      e.printStackTrace();
  } catch (IOException e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>How can I make this work even with Android 3.0 above. Please advice.</p>