You cannot just show a ProgressDialog and then busy waiting a flag. If so the dialog will not show up. You need to busy wait in another thread.
Example:
final ProgressDialog dialog = ProgressDialog.show(
MyActivity.this, "",
"Loading. Please wait...", true);
new Thread(new Runnable() {
public void run() {
while (!isWorkDone)
Thread.yield();
dialog.dismiss();
}
}).start();
No comments:
Post a Comment