am a27868d9: Merge "Fix crash after adding a word to the user dictionary." into honeycomb

* commit 'a27868d9bd2953a9c82deb09edddf8192ddc07f9':
  Fix crash after adding a word to the user dictionary.
This commit is contained in:
Amith Yamasani
2011-01-31 15:22:59 -08:00
committed by Android Git Automerger

View File

@@ -182,9 +182,12 @@ public class SettingsPreferenceFragment extends PreferenceFragment
+ DialogCreatable.class.getName());
}
}
// This dialog fragment could be created from non-SettingsPreferenceFragment
if (mParentFragment instanceof SettingsPreferenceFragment) {
// restore mDialogFragment in mParentFragment
((SettingsPreferenceFragment) mParentFragment).mDialogFragment = this;
}
}
return ((DialogCreatable) mParentFragment).onCreateDialog(mDialogId);
}
@@ -203,6 +206,7 @@ public class SettingsPreferenceFragment extends PreferenceFragment
mOnDismissListener.onDismiss(dialog);
}
}
public int getDialogId() {
return mDialogId;
}
@@ -211,12 +215,15 @@ public class SettingsPreferenceFragment extends PreferenceFragment
public void onDetach() {
super.onDetach();
// This dialog fragment could be created from non-SettingsPreferenceFragment
if (mParentFragment instanceof SettingsPreferenceFragment) {
// in case the dialog is not explicitly removed by removeDialog()
if (((SettingsPreferenceFragment) mParentFragment).mDialogFragment == this) {
((SettingsPreferenceFragment) mParentFragment).mDialogFragment = null;
}
}
}
}
protected boolean hasNextButton() {
return ((ButtonBarHandler)getActivity()).hasNextButton();