views:

881

answers:

2

Hi all, I'm sure this is a simple threading issue but...

I'm starting a ProgressDialog using:

ProgressDialog.show(Example.this, " " , " Loading. Please wait ... ", true,true);

Then running a block of code to download and parse XML.

The problem I'm having is that this is all running under a onClick button method, and that the xml is downloaded and parsed before the dialog is shown.

Any help would be greatly appreciated!

A: 

This is almost certainly a threading issue. Threads are our friends (even if they are annoying to use). That tutorial you found is pretty nice, but I'd suggest you check out the AsyncTask class... it makes life easier. There's a nice writeup on it here.

fiXedd