mirror of
https://github.com/M66B/NetGuard.git
synced 2025-01-03 13:54:09 +00:00
Do not reload rules on opening UI
This commit is contained in:
parent
1a2670424b
commit
58412e27da
1 changed files with 1 additions and 1 deletions
|
@ -53,6 +53,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
||||||
|
|
||||||
// On/off switch
|
// On/off switch
|
||||||
Switch swEnabled = (Switch) view.findViewById(R.id.swEnabled);
|
Switch swEnabled = (Switch) view.findViewById(R.id.swEnabled);
|
||||||
|
swEnabled.setChecked(prefs.getBoolean("enabled", false));
|
||||||
swEnabled.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
swEnabled.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
|
@ -74,7 +75,6 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
swEnabled.setChecked(prefs.getBoolean("enabled", false));
|
|
||||||
|
|
||||||
// Listen for preference changes
|
// Listen for preference changes
|
||||||
prefs.registerOnSharedPreferenceChangeListener(this);
|
prefs.registerOnSharedPreferenceChangeListener(this);
|
||||||
|
|
Loading…
Reference in a new issue