From 77dc179baa7b8fb405633fd46324e336285d10e2 Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Thu, 21 Jan 2010 19:13:34 -0800 Subject: [PATCH] As embedded and full screen shares the same view, we have to replace the AbsoluteLayout with ViewGroup.Layout before setting it to the dialog as dialog's FrameLayout doesn't accept AbsoluteLayout. This should fix the crash when changing orientation. --- core/java/android/webkit/WebView.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 48f8b33004797..b9a214cef4958 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -5796,6 +5796,13 @@ public class WebView extends AbsoluteLayout } mFullScreenHolder = new PluginFullScreenHolder( WebView.this, data.mNpp); + // as we are sharing the View between full screen and + // embedded mode, we have to remove the + // AbsoluteLayout.LayoutParams set by embedded mode to + // ViewGroup.LayoutParams before adding it to the dialog + data.mView.setLayoutParams(new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.FILL_PARENT, + ViewGroup.LayoutParams.FILL_PARENT)); mFullScreenHolder.setContentView(data.mView); mFullScreenHolder.setCancelable(false); mFullScreenHolder.setCanceledOnTouchOutside(false);