android:fix naviator pop when stack is null,finish the activity

This commit is contained in:
pengfei.zhou 2020-01-15 11:26:22 +08:00 committed by osborn
parent 2225514921
commit 5e166de77b

View File

@ -105,7 +105,11 @@ public class DoricPanelFragment extends Fragment implements IDoricNavigator {
@Override @Override
public void pop() { public void pop() {
getNavController().popBackStack(); if (!getNavController().popBackStack()) {
if (getActivity() != null) {
getActivity().finish();
}
}
} }
private NavController getNavController() { private NavController getNavController() {