From 2f30a0d3c34a2121215bae3c3a70af577a67c09d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=96=E5=8D=81?= Date: Thu, 16 Aug 2018 16:39:35 +0800 Subject: [PATCH] add isFinishing? before --- .../github/hurshi/clickedwordslib/WordDetailDialog.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clickedwordslib/src/main/java/com/github/hurshi/clickedwordslib/WordDetailDialog.java b/clickedwordslib/src/main/java/com/github/hurshi/clickedwordslib/WordDetailDialog.java index b19d480..9a26375 100644 --- a/clickedwordslib/src/main/java/com/github/hurshi/clickedwordslib/WordDetailDialog.java +++ b/clickedwordslib/src/main/java/com/github/hurshi/clickedwordslib/WordDetailDialog.java @@ -58,9 +58,11 @@ public void onDismiss(DialogInterface dialogInterface) { // ft.hide(WordDetailDialog.this); // ft.commitAllowingStateLoss(); // dismiss(); - onDialogDismiss(); - if (null != listener) { - listener.onDismiss(); + if (null != getActivity() && !getActivity().isFinishing()) { + onDialogDismiss(); + if (null != listener) { + listener.onDismiss(); + } } } });