Fix bug #16957601 Stability: ISE in Settings: Observer com.android.settings.

SettingsPreferenceFragment$1@273c8fdb was not registered

- add onUnbindPreferences() call to match onBindPreferences()
- this new method is @hide so it does not impact the APIs

Change-Id: Iee0ab8a4ecc2046f89fb96cc52af150e835f658c
This commit is contained in:
Fabrice Di Meglio
2014-08-13 10:41:40 -07:00
parent 72db690850
commit b1a50f2dff

View File

@@ -258,6 +258,7 @@ public abstract class PreferenceFragment extends Fragment implements
*/
public void setPreferenceScreen(PreferenceScreen preferenceScreen) {
if (mPreferenceManager.setPreferences(preferenceScreen) && preferenceScreen != null) {
onUnbindPreferences();
mHavePrefs = true;
if (mInitDone) {
postBindPreferences();
@@ -349,6 +350,10 @@ public abstract class PreferenceFragment extends Fragment implements
protected void onBindPreferences() {
}
/** @hide */
protected void onUnbindPreferences() {
}
/** @hide */
public ListView getListView() {
ensureList();