From 628f2466d6c351357ee7f1fd6623f750d1d6f46a Mon Sep 17 00:00:00 2001 From: cyBerta Date: Tue, 13 Dec 2022 02:37:51 +0100 Subject: don't create a new GatewaysSelectionFragment if it is already shown --- .../leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/src') diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java index fe36e00a..5c4e891e 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java @@ -307,6 +307,10 @@ public class NavigationDrawerFragment extends Fragment implements SharedPreferen manualGatewaySelection.setOnClickListener(v -> { FragmentManagerEnhanced fragmentManager = new FragmentManagerEnhanced(getActivity().getSupportFragmentManager()); closeDrawer(); + Fragment current = fragmentManager.findFragmentByTag(MainActivity.TAG); + if (current instanceof GatewaySelectionFragment) { + return; + } Fragment fragment = new GatewaySelectionFragment(); fragmentManager.replace(R.id.main_container, fragment, MainActivity.TAG); }); -- cgit v1.2.3