summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-12-15 10:51:58 -0800
committerAndrew Lee <anwlee@google.com>2014-12-15 16:26:32 -0800
commit1d4cd7cfc00f957b97351912e91eb2d7612147db (patch)
tree7d3bec845d77f5a5b336c6f416581ff225c618d6
parent0458b213bfdebe7a4c7c263e6e51b072be4498c0 (diff)
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
-rw-r--r--src/com/android/dialer/calllog/ClearCallLogDialog.java8
1 files changed, 7 insertions, 1 deletions
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