私は asynctask を実行しています。終了したら、progressDialog を閉じ、それに応じて AlertDialog を呼び出します。
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Test")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
}
});
AlertDialog alert = builder.create();
alert.show();
アプリでスタンバイ
- アプリでスタンバイ
- 進行中の非同期タスク
- Asynctask が終了し、progressDialog が閉じられます
- (まだアプリで待機中) AlertDialog が正常に表示される
ホーム画面
- 進行中の非同期タスク
- ホーム画面に移動
- Asynctask が終了し、progressDialog が閉じられます
- AlertDialog が呼び出されて表示されます
- アプリに戻りますが、アラート ダイアログが表示されず、代わりに灰色の画面が表示されます。
これを解決する方法はありますか?私はそれを検索しようとしましたが、誰かが同じ問題を抱えていることを見つけることができませんでした..