Improved dialog management in Settings>Users
Bug: 7266284 Delete not functional after orientation change Bug: 7266182 Set up now not functional after orientation change Also remove "vibrate when ringing" on tablets Bug: 7253081 Change-Id: Ie616747f2e3292c401613eb2041b5a5a289cde20
This commit is contained in:
@@ -182,6 +182,10 @@ public class SettingsPreferenceFragment extends PreferenceFragment implements Di
|
||||
}
|
||||
}
|
||||
|
||||
public void onDialogShowing() {
|
||||
// override in subclass to attach a dismiss listener, for instance
|
||||
}
|
||||
|
||||
public static class SettingsDialogFragment extends DialogFragment {
|
||||
private static final String KEY_DIALOG_ID = "key_dialog_id";
|
||||
private static final String KEY_PARENT_FRAGMENT_ID = "key_parent_fragment_id";
|
||||
@@ -215,6 +219,15 @@ public class SettingsPreferenceFragment extends PreferenceFragment implements Di
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
|
||||
if (mParentFragment != null && mParentFragment instanceof SettingsPreferenceFragment) {
|
||||
((SettingsPreferenceFragment) mParentFragment).onDialogShowing();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
if (savedInstanceState != null) {
|
||||
|
Reference in New Issue
Block a user