diff --git a/app/src/main/java/eu/faircode/netguard/ActivityMain.java b/app/src/main/java/eu/faircode/netguard/ActivityMain.java index 49d41fa5..d794bdf3 100644 --- a/app/src/main/java/eu/faircode/netguard/ActivityMain.java +++ b/app/src/main/java/eu/faircode/netguard/ActivityMain.java @@ -53,6 +53,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences // On/off switch Switch swEnabled = (Switch) view.findViewById(R.id.swEnabled); + swEnabled.setChecked(prefs.getBoolean("enabled", false)); swEnabled.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { @@ -74,7 +75,6 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences } } }); - swEnabled.setChecked(prefs.getBoolean("enabled", false)); // Listen for preference changes prefs.registerOnSharedPreferenceChangeListener(this);