Can't display an image from a url
<p>I'm pretty new to programming and my only experience is some very light C# and javascript.</p>

<p>I want to make a simple android app that will just display a picture and some data from the net however I'm having trouble just displaying an image(haven't tried anything else yet). I've searched SO and the web for code examples but can't get them to work. </p>

<p>Here's my AndroidManifest.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="my.test"
    android:versionCode="1"
    android:versionName="1.0" &gt;

    &lt;uses-sdk android:minSdkVersion="15" /&gt;
    &lt;uses-permission android:name="android.permission.INTERNET" /&gt;

    &lt;application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" &gt;
        &lt;activity
            android:name=".TestActivity"
            android:label="@string/app_name" &gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;

                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
    &lt;/application&gt;

&lt;/manifest&gt;
</code></pre>

<p>and my main.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="fill_parent"
android:orientation="vertical" &gt;

&lt;TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/hello" /&gt;



&lt;ImageView
    android:id="@+id/imageView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent" /&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p>and my only Activity</p>

<pre><code>package my.test;

import java.io.InputStream;
import java.net.URL;

import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.widget.ImageView;

public class TestActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    ImageView imgView =(ImageView)findViewById(R.id.imageView1);
    Drawable drawable = LoadImageFromWebOperations("http://www.androidpeople.com/wp-content/uploads/2010/03/android.png");
    imgView.setImageDrawable(drawable);
    }
    private Drawable LoadImageFromWebOperations(String url)
    {
        try
        {
            InputStream is = (InputStream) new URL(url).getContent();
            Drawable d = Drawable.createFromStream(is, "src name");
            return d;
        }catch (Exception e) {
            System.out.println("Exc="+e);
            return null;
        }
    }

}
</code></pre>

<p>I've tried other examples both using an AVD and my phone with the same result: blank screen. What am I doing wrong? </p>
