Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Progressdialog slow to show in Android

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!

like image 734
Ljdawson Avatar asked Oct 12 '09 17:10

Ljdawson


1 Answers

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.

like image 122
Jeremy Logan Avatar answered Nov 17 '22 12:11

Jeremy Logan