Hi,
I'm trying to learn AsyncTask and Thread but Thread first...
I am trying to display a Dialog before "DoSomeTask()" but seems like
the Dialog always come after DoSomeTask().
Did I do something wrong here?
Thanks.
--- code---
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
mainProcessing();
DoSomeTask();
}
private void mainProcessing() {
Thread thread = new Thread(null, doBackgroundThreadProcessing,
"Background");
thread.start();
}
private Runnable doBackgroundThreadProcessing = new Runnable() {
public void run() {
backgroundThreadProcessing();
}
};
private void backgroundThreadProcessing() {
handler.post(doUpdateGUI);
}
private Runnable doUpdateGUI = new Runnable() {
public void run() {
updateGUI();
}
};
private void updateGUI() {
final ProgressDialog dialog = new ProgressDialog(CloseVault.this);
dialog.setMessage("Please wait...");
dialog.show();
}
--
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