From 2ee0d95b61ae82928f0574084af370687e61c1ba Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Mon, 13 Jul 2009 16:13:55 -0700 Subject: [PATCH] Fixing scoping issues where PhoneGap would get Garbage Collected. --- src/com/phonegap/demo/DroidGap.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com/phonegap/demo/DroidGap.java b/src/com/phonegap/demo/DroidGap.java index 4fc09e32..ac9c83ed 100644 --- a/src/com/phonegap/demo/DroidGap.java +++ b/src/com/phonegap/demo/DroidGap.java @@ -41,6 +41,10 @@ public class DroidGap extends Activity { private static final String LOG_TAG = "DroidGap"; private WebView appView; private String uri; + private PhoneGap gap; + private GeoBroker geo; + private AccelListener accel; + /** Called when the activity is first created. */ @Override @@ -89,9 +93,9 @@ public class DroidGap extends Activity { private void bindBrowser(WebView appView) { // The PhoneGap class handles the Notification and Android Specific crap - PhoneGap gap = new PhoneGap(this, appView); - GeoBroker geo = new GeoBroker(appView, this); - AccelListener accel = new AccelListener(this, appView); + gap = new PhoneGap(this, appView); + geo = new GeoBroker(appView, this); + accel = new AccelListener(this, appView); // This creates the new javascript interfaces for PhoneGap appView.addJavascriptInterface(gap, "Device"); appView.addJavascriptInterface(geo, "Geo");