Fixed switch position after denying VPN connection

This commit is contained in:
M66B 2015-11-12 16:13:03 +01:00
parent c0872c2522
commit 89db2ed4f8
1 changed files with 2 additions and 0 deletions

View File

@ -128,6 +128,8 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
swEnabled.setChecked(enabled);
swEnabled.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
prefs.edit().putBoolean("enabled", isChecked).apply();
if (isChecked) {
Log.i(TAG, "Switch on");
final Intent prepare = VpnService.prepare(ActivityMain.this);