From 641e45e727191ddbe5e78f19d892e4262e37d3a0 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 27 Nov 2017 05:22:54 +0100 Subject: SettingsActivity: directly pass through bundle Signed-off-by: Jason A. Donenfeld --- app/src/main/java/com/wireguard/android/SettingsActivity.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/wireguard/android/SettingsActivity.java b/app/src/main/java/com/wireguard/android/SettingsActivity.java index be9f5bf4..bb617b63 100644 --- a/app/src/main/java/com/wireguard/android/SettingsActivity.java +++ b/app/src/main/java/com/wireguard/android/SettingsActivity.java @@ -10,10 +10,8 @@ public class SettingsActivity extends Activity { protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); final FragmentTransaction transaction = getFragmentManager().beginTransaction(); - final Bundle args = new Bundle(); - args.putBoolean("showQuickTile", getIntent().getBooleanExtra("showQuickTile", false)); final SettingsFragment fragment = new SettingsFragment(); - fragment.setArguments(args); + fragment.setArguments(getIntent().getExtras()); transaction.replace(android.R.id.content, fragment).commit(); } @@ -22,7 +20,7 @@ public class SettingsActivity extends Activity { public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); - if (getArguments().getBoolean("showQuickTile")) + if (getArguments() != null && getArguments().getBoolean("showQuickTile")) ((ConfigListPreference) findPreference("primary_config")).show(); } } -- cgit v1.2.3