如何在progressdialog dimiss上打開新活動?ProgressDialog關閉打開新活動
這裏是我的部分代碼:
@Override
public void onClick(View v) {
progressDoalog = new ProgressDialog(Hack.this);
progressDoalog.setMax(100);
progressDoalog.setMessage("Its loading....");
progressDoalog.setTitle("ProgressDialog bar example");
progressDoalog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDoalog.show();
new Thread(new Runnable() {
@Override
public void run() {
try {
while (progressDoalog.getProgress() <= progressDoalog
.getMax()) {
Thread.sleep(200);
handle.sendMessage(handle.obtainMessage());
if (progressDoalog.getProgress() == progressDoalog
.getMax()) {
progressDoalog.dismiss();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}).start();
}
Handler handle = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
progressDoalog.incrementProgressBy(1);
}
};
});
}
請幫我傢伙。我認爲這是在進度完成後打開活動的一個解決方案。
[您可以觸發事件的可能的複製時,Android的對話框關閉?](https://stackoverflow.com/questions/6203720/can-you-fire-an-event-when-android-dialog-is-dismissed) – EKN