From 05eb730ca42eec3a40f916062af7442218135303 Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Mon, 3 Jun 2013 17:24:21 -0700 Subject: Delay removal of windows from WindowManager When relaunching activities the window manager clears out all windows by calling a ViewRootImpl.die() in a deferred fashion. Then it immediately deletes the ViewRootImpl and its view from its list of windows. When the die() is eventually executed it calls dispatchDetachedFromWindow() which tries to remove the previously removed windows causing an Exception to be thrown. This change waits to remove the windows until after die() has been completed. Fixes bug 8253030. Change-Id: I5b41be1c6b776e32128c064267653db98bd95292 --- core/java/android/view/ViewRootImpl.java | 1 + 1 file changed, 1 insertion(+) (limited to 'core/java/android/view/ViewRootImpl.java') diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index bcc58a27e2ff..62e0d3dada03 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -5153,6 +5153,7 @@ public final class ViewRootImpl implements ViewParent, mAdded = false; } + WindowManagerGlobal.getInstance().doRemoveView(this); } public void requestUpdateConfiguration(Configuration config) { -- cgit v1.2.3