fix:android IDoricNavigator pop/push return when activity is finishing
This commit is contained in:
parent
91c3d4f630
commit
ae5ac30fb6
@ -78,6 +78,9 @@ public class DoricPanelFragment extends Fragment implements IDoricNavigator {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void push(String source, String alias, String extra) {
|
public void push(String source, String alias, String extra) {
|
||||||
|
if (getActivity() == null || getActivity().isFinishing()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Bundle argument = new Bundle();
|
Bundle argument = new Bundle();
|
||||||
argument.putString("source", source);
|
argument.putString("source", source);
|
||||||
argument.putString("alias", alias);
|
argument.putString("alias", alias);
|
||||||
@ -86,8 +89,12 @@ public class DoricPanelFragment extends Fragment implements IDoricNavigator {
|
|||||||
.navigate(R.id.action_doricPanelFragment_to_doricPanelFragment, argument);
|
.navigate(R.id.action_doricPanelFragment_to_doricPanelFragment, argument);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void pop() {
|
public void pop() {
|
||||||
|
if (getActivity() == null || getActivity().isFinishing()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!getNavController().popBackStack()) {
|
if (!getNavController().popBackStack()) {
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
getActivity().finish();
|
getActivity().finish();
|
||||||
|
Reference in New Issue
Block a user