From 90738357f6ed39ad23697a265a3d9a9eab95d32e Mon Sep 17 00:00:00 2001 From: "gw0 [http://gw.tnode.com/]" Date: Fri, 3 Oct 2014 09:44:13 +0200 Subject: [PATCH] Fix crash when the view was not removed from the window manager in time. --- library/src/wei/mark/standout/StandOutWindow.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/src/wei/mark/standout/StandOutWindow.java b/library/src/wei/mark/standout/StandOutWindow.java index 0505aff..1020f98 100644 --- a/library/src/wei/mark/standout/StandOutWindow.java +++ b/library/src/wei/mark/standout/StandOutWindow.java @@ -1097,6 +1097,12 @@ public final synchronized Window show(int id) { // get the params corresponding to the id StandOutLayoutParams params = window.getLayoutParams(); + try { + // force remove the view from the window manager to prevent adding it again + mWindowManager.removeView(window); + } catch(IllegalArgumentException ex) { + } + try { // add the view to the window manager mWindowManager.addView(window, params);