summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-03-31 14:14:38 -0700
committerJohn Reck <jreck@google.com>2011-03-31 16:22:56 -0700
commitc7db091b60913927fef214420a21f1e897772d16 (patch)
tree56da21396c717cdc96de1b1d8e101a260cb230c3 /src
parenta2cedb170d90b564b3234e7fb7e598e8698bb638 (diff)
downloadpackages_apps_Browser-c7db091b60913927fef214420a21f1e897772d16.zip
packages_apps_Browser-c7db091b60913927fef214420a21f1e897772d16.tar.gz
packages_apps_Browser-c7db091b60913927fef214420a21f1e897772d16.tar.bz2
DO NOT MERGE Fix widget update listener
Bug: 4193627 Just need to expand the lifecycle during which we listen for preference changes Specifically, instead of listening between onResume and onPause, listen between onCreate and onDestroy since the dialog that sets the preference will cause the fragment to receive an onPause. Change-Id: Ibaa62fc722d74840f159d6023af7ec1543ae4541
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/preferences/GeneralPreferencesFragment.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/browser/preferences/GeneralPreferencesFragment.java b/src/com/android/browser/preferences/GeneralPreferencesFragment.java
index d64f062..0c63ab5 100644
--- a/src/com/android/browser/preferences/GeneralPreferencesFragment.java
+++ b/src/com/android/browser/preferences/GeneralPreferencesFragment.java
@@ -68,6 +68,8 @@ public class GeneralPreferencesFragment extends PreferenceFragment
.getString(BrowserSettings.PREF_HOMEPAGE, null));
((BrowserHomepagePreference) e).setCurrentPage(
getActivity().getIntent().getStringExtra(BrowserPreferencesPage.CURRENT_PAGE));
+ mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
+ mSharedPrefs.registerOnSharedPreferenceChangeListener(mListener);
}
@Override
@@ -94,13 +96,11 @@ public class GeneralPreferencesFragment extends PreferenceFragment
// Setup the proper state for the sync with chrome item
mChromeSync = findPreference(PREF_CHROME_SYNC);
refreshUi();
- mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
- mSharedPrefs.registerOnSharedPreferenceChangeListener(mListener);
}
@Override
- public void onPause() {
- super.onPause();
+ public void onDestroy() {
+ super.onDestroy();
mSharedPrefs.unregisterOnSharedPreferenceChangeListener(mListener);
}