Commit 0ee615ac authored by Max Lv's avatar Max Lv

Ensure the fragment is unregistered onPause

It's quite tricky to avoid getActivity() returns null
http://stackoverflow.com/questions/8914368/getactivity-return-null-in-preferencefragment
parent ce023bf4
......@@ -118,6 +118,7 @@ class ShadowsocksSettings extends PreferenceFragment with OnSharedPreferenceChan
override def onPause {
super.onPause()
ShadowsocksApplication.settings.unregisterOnSharedPreferenceChangeListener(this)
}
def onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) = key match {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment