Display picture on Android app
<p>I'm trying to retrieve a pic which is on a server. So i'm trying to retrieve it with th following method:</p>

<pre><code>  static Bitmap downloadBitmap(String url) {
    final AndroidHttpClient client = AndroidHttpClient.newInstance("Android");
    final HttpGet getRequest = new HttpGet(url);

    try {
        HttpResponse response = client.execute(getRequest);
        final int statusCode = response.getStatusLine().getStatusCode();
        if (statusCode != HttpStatus.SC_OK) { 
            Log.w("ImageDownloader", "Error " + statusCode + " while retrieving bitmap from " + url); 
            return null;
        }

        final HttpEntity entity = response.getEntity();
        if (entity != null) {
            InputStream inputStream = null;
            try {
                inputStream = entity.getContent(); 
                final Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
                return bitmap;
            } finally {
                if (inputStream != null) {
                    inputStream.close();  
                }
                entity.consumeContent();
            }
        }
    } catch (Exception e) {
        // Could provide a more explicit error message for IOException or IllegalStateException
        getRequest.abort();
    } finally {
        if (client != null) {
            client.close();
        }
    }
    return null;
}
</code></pre>

<p>Then in another method i have the following two lines:</p>

<pre><code>      ImageView e = (ImageView) findViewById(R.id.img);
      e.setImageBitmap(downloadBitmap(img_url(param1.img)));
</code></pre>

<p>And the xml</p>

<pre><code>      &lt;?xml version="1.0" encoding="utf-8"?&gt;

&lt;LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"&gt;
    &lt;!-- Name Label --&gt;
    &lt;ImageView
      android:id="@+id/img"  
      android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:contentDescription="@string/picture"&gt;         
    &lt;/ImageView&gt;
</code></pre>

<p></p>

<p>However the picture is not being displayed and i don't receive any error.
Can anyone tell me what i'm doing wrong?</p>
