diff options
author | Lifu Tang <lifu@google.com> | 2014-07-14 12:25:02 -0700 |
---|---|---|
committer | Lifu Tang <lifu@google.com> | 2014-07-14 21:06:26 +0000 |
commit | 218f99c0e56bf43d66690d92a151efcb711d2fcd (patch) | |
tree | 30ae1512c6709e5a6d6b169613eb31b18d1a6af0 /src | |
parent | f43bbeb247fdcdbf8fdc6b5ffbd437797a99ce6b (diff) | |
download | packages_apps_Settings-218f99c0e56bf43d66690d92a151efcb711d2fcd.tar.gz packages_apps_Settings-218f99c0e56bf43d66690d92a151efcb711d2fcd.tar.bz2 packages_apps_Settings-218f99c0e56bf43d66690d92a151efcb711d2fcd.zip |
Register the listener for switch during onResume
- Fix b/16118646
Change-Id: I9ec87422ecc4e05ca332e116af71c07f06c6c65a
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/location/LocationSettings.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/settings/location/LocationSettings.java b/src/com/android/settings/location/LocationSettings.java index 184c38776..474a857c0 100644 --- a/src/com/android/settings/location/LocationSettings.java +++ b/src/com/android/settings/location/LocationSettings.java @@ -73,7 +73,6 @@ public class LocationSettings extends LocationSettingsBase mSwitchBar = activity.getSwitchBar(); mSwitch = mSwitchBar.getSwitch(); - mSwitchBar.addOnSwitchChangeListener(this); mSwitchBar.show(); } @@ -81,7 +80,6 @@ public class LocationSettings extends LocationSettingsBase public void onDestroyView() { super.onDestroyView(); - mSwitchBar.removeOnSwitchChangeListener(this); mSwitchBar.hide(); } @@ -94,6 +92,7 @@ public class LocationSettings extends LocationSettingsBase public void onResume() { super.onResume(); createPreferenceHierarchy(); + mSwitchBar.addOnSwitchChangeListener(this); mValidListener = true; } @@ -105,6 +104,7 @@ public class LocationSettings extends LocationSettingsBase // Ignore exceptions caused by race condition } super.onPause(); + mSwitchBar.removeOnSwitchChangeListener(this); mValidListener = false; } |