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
This commit is contained in:
Max Lv
2015-12-16 17:05:49 +08:00
parent ce023bf49b
commit 0ee615ac6c
@@ -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 {