1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2024-12-22 07:43:15 +00:00

Do not reload rules on opening UI

This commit is contained in:
M66B 2015-10-25 18:30:44 +01:00
parent 1a2670424b
commit 58412e27da

View file

@ -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);