summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/calllog/ClearCallLogDialog.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/dialer/calllog/ClearCallLogDialog.java b/src/com/android/dialer/calllog/ClearCallLogDialog.java
index f4c75d10d..bef5010ec 100644
--- a/src/com/android/dialer/calllog/ClearCallLogDialog.java
+++ b/src/com/android/dialer/calllog/ClearCallLogDialog.java
@@ -16,6 +16,7 @@
package com.android.dialer.calllog;
+import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
@@ -56,6 +57,7 @@ public class ClearCallLogDialog extends DialogFragment {
final ProgressDialog progressDialog = ProgressDialog.show(getActivity(),
getString(R.string.clearCallLogProgress_title),
"", true, false);
+ progressDialog.setOwnerActivity(getActivity());
final AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
@@ -67,7 +69,9 @@ public class ClearCallLogDialog extends DialogFragment {
}
@Override
protected void onPostExecute(Void result) {
- if (getActivity() == null || getActivity().isDestroyed()) {
+ final Activity activity = progressDialog.getOwnerActivity();
+
+ if (activity == null || activity.isDestroyed() || activity.isFinishing()) {
return;
}