From 1d4cd7cfc00f957b97351912e91eb2d7612147db Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 15 Dec 2014 10:51:58 -0800 Subject: Check for cases before clearing dialog. It's possible that it may no longer be necessary to dismiss this specific dialog. For example, there may have been a rotation; in those cases, we expect the DialogFragment to cleanup/dismiss its own dialog. Bug: 18728214 Change-Id: I307c299b1f0a6dabebaf4ac6af1d126bf548b190 --- src/com/android/dialer/calllog/ClearCallLogDialog.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/android/dialer/calllog/ClearCallLogDialog.java b/src/com/android/dialer/calllog/ClearCallLogDialog.java index e6b4ce29c..f4c75d10d 100644 --- a/src/com/android/dialer/calllog/ClearCallLogDialog.java +++ b/src/com/android/dialer/calllog/ClearCallLogDialog.java @@ -67,7 +67,13 @@ public class ClearCallLogDialog extends DialogFragment { } @Override protected void onPostExecute(Void result) { - progressDialog.dismiss(); + if (getActivity() == null || getActivity().isDestroyed()) { + return; + } + + if (progressDialog != null && progressDialog.isShowing()) { + progressDialog.dismiss(); + } } }; // TODO: Once we have the API, we should configure this ProgressDialog -- cgit v1.2.3