diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2020-02-23 20:09:46 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2020-02-25 09:53:01 +0530 |
commit | 071091bc8c24893219650d34dc11ebcb4dfeb2d3 (patch) | |
tree | 7d9994a1bb45202059c4a547c6ea2a5cd4622357 /app/src/main/java | |
parent | 62f27c77795b147b4b431a2339092f84d25d7c68 (diff) |
Resolve deprecation warnings
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.java | 5 | ||||
-rw-r--r-- | app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java | 6 |
2 files changed, 4 insertions, 7 deletions
diff --git a/app/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.java b/app/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.java index 960b6d93..a93fabf6 100644 --- a/app/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.java +++ b/app/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.java @@ -171,11 +171,10 @@ public class TunnelEditorFragment extends BaseFragment implements AppExclusionLi } public void onRequestSetExcludedApplications(@SuppressWarnings("unused") final View view) { - final FragmentManager fragmentManager = getFragmentManager(); - if (fragmentManager != null && binding != null) { + if (binding != null) { final ArrayList<String> excludedApps = new ArrayList<>(binding.getConfig().getInterface().getExcludedApplications()); final AppListDialogFragment fragment = AppListDialogFragment.newInstance(excludedApps, this); - fragment.show(fragmentManager, null); + fragment.show(getParentFragmentManager(), null); } } diff --git a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java index d903fa10..fe8a3da1 100644 --- a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java +++ b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java @@ -79,9 +79,7 @@ public class TunnelListFragment extends BaseFragment { Config.parse(new ByteArrayInputStream(configText.getBytes(StandardCharsets.UTF_8))); // Config text is valid, now create the tunnel… - final FragmentManager fragmentManager = getFragmentManager(); - if (fragmentManager != null) - ConfigNamingDialogFragment.newInstance(configText).show(fragmentManager, null); + ConfigNamingDialogFragment.newInstance(configText).show(getParentFragmentManager(), null); } catch (final BadConfigException | IOException e) { onTunnelImportFinished(Collections.emptyList(), Collections.singletonList(e)); } @@ -220,7 +218,7 @@ public class TunnelListFragment extends BaseFragment { binding.createFab.setOnClickListener(v -> { final AddTunnelsSheet bottomSheet = new AddTunnelsSheet(); bottomSheet.setTargetFragment(this, REQUEST_TARGET_FRAGMENT); - bottomSheet.show(requireFragmentManager(), "BOTTOM_SHEET"); + bottomSheet.show(getParentFragmentManager(), "BOTTOM_SHEET"); }); binding.executePendingBindings(); EdgeToEdge.setUpRoot((ViewGroup) binding.getRoot()); |