diff --git a/src/com/github/shadowsocks/Shadowsocks.java b/src/com/github/shadowsocks/Shadowsocks.java index c5c374a6..08b283c9 100755 --- a/src/com/github/shadowsocks/Shadowsocks.java +++ b/src/com/github/shadowsocks/Shadowsocks.java @@ -178,8 +178,11 @@ public class Shadowsocks extends UnifiedSherlockPreferenceActivity @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { if (compoundButton == switchButton) { + final SharedPreferences settings = + PreferenceManager.getDefaultSharedPreferences(Shadowsocks.this); + settings.edit().putBoolean("isRunning", true).commit(); if (!serviceStart()) { - switchButton.setChecked(false); + settings.edit().putBoolean("isRunning", false).commit(); } } }