Private static ProgressDialog loading;
public void downloadData(){
Thread t = new Thread(){
public void run(){
//download stuff
}
handler.sendEmptyMessage(0);
};
t.start();
try{
t.join();
}catch(InterruptedException ignore){}
}
private Handler handler = new Handler(){
@Override
public void handleMessage(Message msg) {
loading.dismiss();
}
};
When I call donloadData without using t.join()
it displays the ProgressDialog.
However, when using t.join()
, the t thread seems to execute correctly but the ProgressDialog
does not show.
Why is the ProgressDialog
not showing?
Any suggestions on what to change so that I can use t.join()
and display the ProgressDialog
?