No, it doesn't. It's essentially same thing I did, but to make sure I
ran your code with the following test code to make sure:
ProgressDialog pDialog = new ProgressDialog(this);
pDialog.setMessage("Your Message");
pDialog.show();
try{
Thread.sleep(4000);
}catch(Exception e){}
pDialog.dismiss();
What happens is: a dialog is never shown and seems like nothing
happens for the 4 seconds. If i remove the dismiss(), the program
waits 4 seconds, and THEN shows the dialog. Makes it appear as if show
() gets run only after thread sleeps.
Any ideas?
On Sep 22, 2:00 am, Beanie <[email protected]> wrote:
> This should work
>
> ProgressDialog pDialog = new ProgressDialog(context);
> pDialog.setMessage("Your Message");
> pDialog.show();
>
> And when you want to close the dialog,
> pDialog.dismiss();
>
> Dexter.
>
> On Sep 22, 11:38 am, Feras <[email protected]> wrote:
>
> > I have 2 questions actually, while we're on the subject :)
>
> > 1. I have some code in my program that processes some stuff, and
> > takes a few seconds. So I thought logically I can place my dialog show
> > at the beginning before processing begins, and cancel it at the end.
> > What ACTUALLY seems to be happening is my dialog shows after the
> > processing is done... Some demo code to show what I mean with a simple
> > sleep:
>
> > ProgressDialog p = ProgressDialog.show(v.getContext(), "updating
> > things" "things are updating");
> > try{
> > Thread.sleep(4000);}catch(Exception e){}
>
> > p.cancel();
>
> > You would assume it'd show the dialog, process/sleep for 4 seconds,
> > then cancel it. but it doesnt.
>
> > 2. How can I remove the title bar entirely from the dialog? I've seen
> > some apps that do this, and am wondering if there's a simple way to do
> > this programatically, since I dont see that option in the docs.
>
> > thanks :)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---