diff options
author | Michael Kolb <kolby@google.com> | 2011-08-17 10:45:45 -0700 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2011-08-17 10:45:45 -0700 |
commit | 199e43c5208d96db80caabb2b28c31080c0dc6b7 (patch) | |
tree | ca33991da5101b6991734c6bf1ca5fefa86fc987 | |
parent | b07c83a1032f44ec9e54334842cd7d7db7f62fa1 (diff) | |
download | packages_apps_Browser-199e43c5208d96db80caabb2b28c31080c0dc6b7.zip packages_apps_Browser-199e43c5208d96db80caabb2b28c31080c0dc6b7.tar.gz packages_apps_Browser-199e43c5208d96db80caabb2b28c31080c0dc6b7.tar.bz2 |
check for parent before embedding titlebar
Bug: 5166956
remove tbar from parent before embedding
Change-Id: I3a3423bbb8f857bc8a9e9ac7b8a900f85a85e360
-rw-r--r-- | src/com/android/browser/PhoneUi.java | 6 |
1 files changed, 5 insertions, 1 deletions
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); |