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.
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 @@
}
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());