Q:

Black screen when loading web image to Android

When loading an image from the web I am getting a black screen.
I took the page from the web turned it in to a canvas and then set it to the ImageView.
Now when I load it I am getting a black screen in the image.
Activity's code:
public class ImageActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        ImageView i = (ImageView) findViewById(R.id.imageView1);

        try {
            String url = "http://www.rotoworld.com/images/headshots/NBA/1372.jpg";
            Drawable image = ImageOperations(this, url);
            i.setImageDrawable(image);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        i.setMinimumWidth(22);
        i.setMinimumHeight(22);

        i.setMaxWidth(22);
        i.setMaxHeight(22);

    }

    private Drawable ImageOperations(Context ctx, String url) {
        try {
            InputStream is = (InputStream) this.fetch(url);
            Drawable d = Drawable.createFromStream(is, "src");
            return d;
        } catch (MalformedURLException e) {
            return null;
        } catch (IOException e) {
            return null;
        }
    }

    public Object fetch(String address) throws MalformedURLException, IOException {

        URL url = new URL(address);
        Object content = url.getContent();
        return content;
    }

}

XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/hello" />

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/ic_launcher" />

A:

The usual reason for getting a black screen when opening an activity in android is that it takes to long to create the activity.
I think you should put the fetching of your image in a AsyncTask or similar.

