summaryrefslogtreecommitdiff
path: root/core/java/android/app/Dialog.java
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2013-06-10 11:27:26 -0700
committerCraig Mautner <cmautner@google.com>2013-06-10 11:39:21 -0700
commit92098c7c30bc76310a066b220e625fa9aa4b925d (patch)
treec3fdb07fba38dea942861d1df26a25b8ec27e661 /core/java/android/app/Dialog.java
parentbe4e6aaa0252dd7da28b7aa85beba982538efa46 (diff)
Dismiss immediately to maintain consistent state.
Fix bug introduced by deferring nulling of mParent. In dismissDialog the removal was being put on a queue while the state of the Dialog was being updated immediately. This meant that if a show() was called before the remove was executed it would try and add the DecorView a second time. Boom! Fixes bug 9370301. Change-Id: I576d1e207c786bc2e21dfd40cb94f2b63a020fe2
Diffstat (limited to 'core/java/android/app/Dialog.java')
-rw-r--r--core/java/android/app/Dialog.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java
index 634fa30c1c40..cda2c5f3b7c5 100644
--- a/core/java/android/app/Dialog.java
+++ b/core/java/android/app/Dialog.java
@@ -306,6 +306,7 @@ public class Dialog implements DialogInterface, Window.Callback,
* method to do cleanup when the dialog is dismissed, instead implement
* that in {@link #onStop}.
*/
+ @Override
public void dismiss() {
if (Looper.myLooper() == mHandler.getLooper()) {
dismissDialog();
@@ -325,7 +326,7 @@ public class Dialog implements DialogInterface, Window.Callback,
}
try {
- mWindowManager.removeView(mDecor);
+ mWindowManager.removeViewImmediate(mDecor);
} finally {
if (mActionMode != null) {
mActionMode.finish();
@@ -334,7 +335,7 @@ public class Dialog implements DialogInterface, Window.Callback,
mWindow.closeAllPanels();
onStop();
mShowing = false;
-
+
sendDismissMessage();
}
}