diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-10-08 17:58:35 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-08 17:58:35 -0700 |
commit | d7dccd26115851c49c91db204f88db7a7973b2f6 (patch) | |
tree | 715bdf3538d05fb0fef52aa5facceb9cb82666bc | |
parent | 682d143decaa390f55428ac7b6c730831f54077d (diff) | |
parent | 55f1b0b82f0d9f6d43b9b2e246d9de0c810e7a7f (diff) | |
download | frameworks_base-d7dccd26115851c49c91db204f88db7a7973b2f6.zip frameworks_base-d7dccd26115851c49c91db204f88db7a7973b2f6.tar.gz frameworks_base-d7dccd26115851c49c91db204f88db7a7973b2f6.tar.bz2 |
am 55f1b0b8: am 9d6824cd: Merge "Make Activity.removeDialog() less strict." into gingerbread
Merge commit '55f1b0b82f0d9f6d43b9b2e246d9de0c810e7a7f'
* commit '55f1b0b82f0d9f6d43b9b2e246d9de0c810e7a7f':
Make Activity.removeDialog() less strict.
-rw-r--r-- | core/java/android/app/Activity.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 7c87b79..f08d88d 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -2852,6 +2852,10 @@ public class Activity extends ContextThemeWrapper * <p>This can be useful if you know that you will never show a dialog again and * want to avoid the overhead of saving and restoring it in the future. * + * <p>As of {@link android.os.Build.VERSION_CODES#GINGERBREAD}, this function + * will not throw an exception if you try to remove an ID that does not + * currently have an associated dialog.</p> + * * @param id The id of the managed dialog. * * @see #onCreateDialog(int, Bundle) @@ -2860,17 +2864,13 @@ public class Activity extends ContextThemeWrapper * @see #dismissDialog(int) */ public final void removeDialog(int id) { - if (mManagedDialogs == null) { - return; - } - - final ManagedDialog md = mManagedDialogs.get(id); - if (md == null) { - return; + if (mManagedDialogs != null) { + final ManagedDialog md = mManagedDialogs.get(id); + if (md != null) { + md.mDialog.dismiss(); + mManagedDialogs.remove(id); + } } - - md.mDialog.dismiss(); - mManagedDialogs.remove(id); } /** |