From 5e166de77b56e85cff98b34b20bf994592d4a059 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 15 Jan 2020 11:26:22 +0800 Subject: [PATCH] android:fix naviator pop when stack is null,finish the activity --- .../doric/src/main/java/pub/doric/DoricPanelFragment.java | 6 +++++- 1 file changed, 5 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 f65af747..adc9c57e 100644 --- a/doric-android/doric/src/main/java/pub/doric/DoricPanelFragment.java +++ b/doric-android/doric/src/main/java/pub/doric/DoricPanelFragment.java @@ -105,7 +105,11 @@ public class DoricPanelFragment extends Fragment implements IDoricNavigator { @Override public void pop() { - getNavController().popBackStack(); + if (!getNavController().popBackStack()) { + if (getActivity() != null) { + getActivity().finish(); + } + } } private NavController getNavController() {