From e6db23d77cac0fc7dc18d58baf2c0ca8d01af7c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Sat, 11 Jan 2020 12:03:49 +0800 Subject: [PATCH] fix context teardown multiple times --- .../doric/src/main/java/pub/doric/DoricPanelFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doric-android/doric/src/main/java/pub/doric/DoricPanelFragment.java b/doric-android/doric/src/main/java/pub/doric/DoricPanelFragment.java index 40c3af43..f65af747 100644 --- a/doric-android/doric/src/main/java/pub/doric/DoricPanelFragment.java +++ b/doric-android/doric/src/main/java/pub/doric/DoricPanelFragment.java @@ -127,6 +127,8 @@ public class DoricPanelFragment extends Fragment implements IDoricNavigator { @Override public void onDestroy() { super.onDestroy(); - doricPanel.onActivityDestroy(); + if (getActivity() == null || !getActivity().isFinishing()) { + doricPanel.onActivityDestroy(); + } } }