Progress Dialog in Android doesn't Show?

Posted by Tyler on Stack Overflow See other posts from Stack Overflow or by Tyler
Published on 2010-05-19T23:02:46Z Indexed on 2010/05/19 23:10 UTC
Read the original article Hit count: 345

Filed under:
|
|

Okay.. I am doing something similar to the below:

private void onCreate() {
    final ProgressDialog dialog = ProgressDialog.show(this, "Please wait..", "Doing stuff..", true);
Thread t = new Thread() {
    public void run() {
        //do some serious stuff...
        dialog.dismiss();           
    }
};
t.start(); 
t.join();
stepTwo();

}

However, what I am finding is that my progress dialog never even shows up. My App stalls for a moment so I know it is chugging along inside of thread t, but why doesnt my dialog appear?

IF I remove the line:

t.join();

Then what I find happens is that the progress dialog does show up, but my app starts stepTwo(); before what happens in the thread is complete..

Any ideas?

© Stack Overflow or respective owner

Related posts about android

Related posts about java