From f8de8ecc321fe5b45846adc38d174d5bc2208f20 Mon Sep 17 00:00:00 2001 From: Patrick Scott Date: Mon, 21 Sep 2009 16:37:29 -0400 Subject: [PATCH] Check for a valid token before adding the fake title bar. This is basically what happens when adding the view to the window. In some cases, the decor view may be null or the window token may be null which throws an exception. --- src/com/android/browser/BrowserActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index dc85ec0..7f8c0c6 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -950,8 +950,10 @@ public class BrowserActivity extends Activity } private void showFakeTitleBar() { + final View decor = getWindow().peekDecorView(); if (mFakeTitleBar == null && mActiveTabsPage == null - && !mActivityInPause) { + && !mActivityInPause && decor != null + && decor.getWindowToken() != null) { final WebView webView = getTopWindow(); mFakeTitleBar = new TitleBar(this); mFakeTitleBar.setTitleAndUrl(null, webView.getUrl()); -- 2.11.0