android UI not showing up while processing other data
<p>I'm trying to read in 17 images from the Internet while displaying a splash screen. However with the following code, the splash screen does not show up at all during the processing. It goes black, finishes and transits to the next activity. I thought calling setContentView before the processing code is good enough but apparently not. </p>

<p>What am I missing?</p>

<p>Thanks for your help.</p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splash);


    // read the bitmaps
    // Open a new URL and get the InputStream to load data from it

    // Start reading the XML and filling the arrays
    for (int i=0; i&lt;16; i++) {
        try {
            URL aURL = new URL (districtImage[i]);
            URLConnection conn = aURL.openConnection();
            conn.connect();
            InputStream is = conn.getInputStream();
            // Buffered is always good for performance
            BufferedInputStream bis = new BufferedInputStream(is);
            districtBitmap[i] = BitmapFactory.decodeStream(bis);
            bis.close();
            is.close();
        }
        catch (IOException e){
            Log.e ("DEBUGTAG","Cannot load remote image", e);
        }
    }
    ... some more code to transit to next activity...
}
</code></pre>
