I came across a problem with the ProgressDialog.

I am using a ProgressDialog and a Thread for some networking stuff. I
want the ProgressDialog to be dismissed when the Thread finishes its
work. I am using a Handler to dismiss the ProgressDialog but i don't
know how to continue my
main program flow after the progress dialog. I tried to use a while
loop that called a method from the Thread indicating when the
networking staff was over, but then the ProgressDialog didn't show
until the Thread completed its work.

My code looks like this.

net = new Thread(this.handler);
ProgressDialog.show(this, "Title", "Message");
while(!net.getResult()){
//Wait
}
//Continue the normal program flow


The only solution that i can think of is to create a method for the
program flow after the ProgressDialog and call that method from the
handler class.

Any ideas on that?

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to