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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user