diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-03-11 13:17:57 -0800 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-03-11 13:48:32 -0800 |
commit | cf407ad88bef3bc640489b300f23eaa8ea0b724e (patch) | |
tree | e4690beb12fc2a68a7466a08a0a302fa41b2fdb3 /core/java/android/preference | |
parent | 0eb7b697b7c180660647b5cd0cd7dd067f6b6abb (diff) | |
download | frameworks_base-cf407ad88bef3bc640489b300f23eaa8ea0b724e.zip frameworks_base-cf407ad88bef3bc640489b300f23eaa8ea0b724e.tar.gz frameworks_base-cf407ad88bef3bc640489b300f23eaa8ea0b724e.tar.bz2 |
Fix issues #4087362 and #4087356
4087362: Provide a safer way to call DialogFragment.dismiss()
4087356: PreferenceActivity.invalidateHeaders() can cause
IllegalStateException: Can not perform this action after onSaveInstanceState
These are very safe; the first is just a new public API that
allows you to use an existing feature in DialogFragment, and the
second just uses the version of commit that avoids the failure if
happening at a point where the operation would be lost if restored
from the last state (which is no big deal for preferences).
Change-Id: I53971c9fb1efdcd599694cdcd4585b81afc156b8
Diffstat (limited to 'core/java/android/preference')
-rw-r--r-- | core/java/android/preference/PreferenceActivity.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/preference/PreferenceActivity.java b/core/java/android/preference/PreferenceActivity.java index 2b609ea..ad0bc84 100644 --- a/core/java/android/preference/PreferenceActivity.java +++ b/core/java/android/preference/PreferenceActivity.java @@ -1049,7 +1049,7 @@ public abstract class PreferenceActivity extends ListActivity implements FragmentTransaction transaction = getFragmentManager().beginTransaction(); transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); transaction.replace(com.android.internal.R.id.prefs, f); - transaction.commit(); + transaction.commitAllowingStateLoss(); } /** @@ -1144,7 +1144,7 @@ public abstract class PreferenceActivity extends ListActivity implements } else { transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); } - transaction.commit(); + transaction.commitAllowingStateLoss(); } /** @@ -1184,7 +1184,7 @@ public abstract class PreferenceActivity extends ListActivity implements } transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN); transaction.addToBackStack(BACK_STACK_PREFS); - transaction.commit(); + transaction.commitAllowingStateLoss(); } } |