【发布时间】:2010-02-26 18:26:22
【问题描述】:
1) 我启动了一个后台任务(通过 AsyncTask)
new FindJourneyTask().execute(); // FindJourneyTask extends AsyncTask
2) 仍在主线程中(就在新线程启动之前)我使用 showDialog(dialogId) 创建了一个对话框
// this method is in FindJourneyTask
protected void onPreExecute() {
showDialog(DIALOG_FINDING_JOURNEY);
}
3) 屏幕方向改变,Activity 被重新创建
4) 我现在如何关闭 FindJourneyTask 中的对话框?调用dismissDialog(dialogId) 什么都不做。
// this method is in FindJourneyTask
protected void onPostExecute(FindJourneyResult result) {
dismissDialog(DIALOG_FINDING_JOURNEY); // does nothing
}
【问题讨论】:
-
发布您的代码,以便我们查看您做错了什么。
标签: android