If i understand correctly, you're showing it and closing it in the same thread and in the same method... That seem wrong to me in event driven development.
I would have a piloting thread (like the one which instantiate your activity) that launch your long process IN ANOTHER THREAD, and create the progress dialog to call its show method (the progress dialog will also have its own thread but that's not your concern) and that's all for your doStuff() method. Things are then executed asynchronously. (which is why you have a progress bar...) Then at the end of the processing thread, you dismiss the progress dialog. Hope it helps Arnaudweb 2009/4/9 jj <[email protected]> > > Hi everybody > > I am having a problem displayin a ProgressDialog. I hope someone can > show me what I am doing wrong... > > > void doStuff() > { > myProgressDialog = ProgressDialog.show(layout.getContext(),"Please > wait...", "Downloading content...", true); > > /* > Here I do my stuff > */ > myProgressDialog.dismiss(); > } > > The problem is that the progressDialog is not shown inmediately. > I have tried doing layout.invalidate(), or layout.postInvalidate(), > and still the same: > the progressDialog is only shown if, for example, I remove the .dismiss > () instruction, and I call the doStuff() again > > so, the progressDialog is there, but I dont know how to show it > inmediately > > > any ideas? > Thanks > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

