From f9faf01dc0f847e51faafbe9b4b5082719cbf3cb Mon Sep 17 00:00:00 2001 From: cyBerta Date: Mon, 7 Aug 2023 01:25:39 +0200 Subject: Fixes various bugs related to the re-creation of the SetupActivity and the loaded Fragments after an layout orientation change. * fixes the initialization of fragments via a Bundle * saves state before the Activity/Fragments get destroyed and loads the old state on re-creation * fixes onFragmentSelected() callback handling --- .../fragments/VpnPermissionSetupFragment.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/VpnPermissionSetupFragment.java') diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/VpnPermissionSetupFragment.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/VpnPermissionSetupFragment.java index a6af0b36..188ba9ac 100644 --- a/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/VpnPermissionSetupFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/VpnPermissionSetupFragment.java @@ -13,13 +13,10 @@ import se.leap.bitmaskclient.databinding.FVpnPermissionSetupBinding; public class VpnPermissionSetupFragment extends BaseSetupFragment { - - private VpnPermissionSetupFragment(int position) { - super(position); - } - public static VpnPermissionSetupFragment newInstance(int position) { - return new VpnPermissionSetupFragment(position); + VpnPermissionSetupFragment fragment = new VpnPermissionSetupFragment(); + fragment.setArguments(initBundle(position)); + return fragment; } @Override @@ -29,11 +26,6 @@ public class VpnPermissionSetupFragment extends BaseSetupFragment { return binding.getRoot(); } - @Override - public void onAttach(@NonNull Context context) { - super.onAttach(context); - } - @Override public void onFragmentSelected() { super.onFragmentSelected(); -- cgit v1.2.3