From 199e43c5208d96db80caabb2b28c31080c0dc6b7 Mon Sep 17 00:00:00 2001 From: Michael Kolb Date: Wed, 17 Aug 2011 10:45:45 -0700 Subject: check for parent before embedding titlebar Bug: 5166956 remove tbar from parent before embedding Change-Id: I3a3423bbb8f857bc8a9e9ac7b8a900f85a85e360 --- src/com/android/browser/PhoneUi.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/com/android/browser/PhoneUi.java') diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java index 49419aa..052d97e 100644 --- a/src/com/android/browser/PhoneUi.java +++ b/src/com/android/browser/PhoneUi.java @@ -21,7 +21,6 @@ import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.app.Activity; -import android.app.ActivityManager; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; @@ -34,6 +33,7 @@ import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.view.ViewGroup; import android.view.accessibility.AccessibilityEvent; import android.view.animation.DecelerateInterpolator; import android.webkit.WebView; @@ -246,6 +246,10 @@ public class PhoneUi extends BaseUi { } WebView web = getWebView(); if (web != null) { + // make sure we can re-parent titlebar + if ((mTitleBar != null) && (mTitleBar.getParent() != null)) { + ((ViewGroup) mTitleBar.getParent()).removeView(mTitleBar); + } web.setEmbeddedTitleBar(mTitleBar); } setTitleGravity(Gravity.NO_GRAVITY); -- cgit v1.1