Remove Popup immediately rather than defer it.

Delaying the popup by using removeView instead of removeViewImmediate
caused an error when the removal was actually executed after the parent
window was deleted along with the popup.

Fixes bug 6407801.

Change-Id: Ieb17d58467aaf16e1a24f47187f52766d694ba32
This commit is contained in:
Craig Mautner
2012-05-23 08:48:39 -07:00
parent ae14715284
commit b82d074038

View File

@@ -1253,13 +1253,13 @@ public class PopupWindow {
unregisterForScrollChanged();
try {
mWindowManager.removeView(mPopupView);
mWindowManager.removeViewImmediate(mPopupView);
} finally {
if (mPopupView != mContentView && mPopupView instanceof ViewGroup) {
((ViewGroup) mPopupView).removeView(mContentView);
}
mPopupView = null;
if (mOnDismissListener != null) {
mOnDismissListener.onDismiss();
}