From 834be3d1e3c9e1558ce727633213c77d6646631a Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Tue, 25 Oct 2011 14:02:12 -0400 Subject: [PATCH] Bug 697183 - Fix crash on rotation (r=lucasr) Prevent an NullPointerException caused by mBrowserToolbar not being initialized before use. Happens only on rotation because it gets used only when there is an active tab. --- embedding/android/GeckoApp.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/embedding/android/GeckoApp.java b/embedding/android/GeckoApp.java index a60b2d3aa6c..d39ac15c2de 100644 --- a/embedding/android/GeckoApp.java +++ b/embedding/android/GeckoApp.java @@ -1065,6 +1065,9 @@ abstract public class GeckoApp // setup gecko layout mGeckoLayout = (RelativeLayout) findViewById(R.id.gecko_layout); + mMainLayout = (LinearLayout) findViewById(R.id.main_layout); + mBrowserToolbar = (BrowserToolbar) findViewById(R.id.browser_toolbar); + mDoorHanger = new DoorHanger(this); Tab tab = Tabs.getInstance().getSelectedTab(); @@ -1110,9 +1113,6 @@ abstract public class GeckoApp }); } - mMainLayout = (LinearLayout) findViewById(R.id.main_layout); - mBrowserToolbar = (BrowserToolbar) findViewById(R.id.browser_toolbar); - //register for events GeckoAppShell.registerGeckoEventListener("DOMContentLoaded", GeckoApp.mAppContext); GeckoAppShell.registerGeckoEventListener("DOMTitleChanged", GeckoApp.mAppContext);