summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}