From 53410781e4585b3fec3444b8f22d01da41d790d3 Mon Sep 17 00:00:00 2001 From: Bryce Curtis Date: Fri, 15 Jul 2011 15:00:12 -0500 Subject: [PATCH] Issue #154: Propagate existing parameters when starting new DroidGap activity. --- framework/src/com/phonegap/DroidGap.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/framework/src/com/phonegap/DroidGap.java b/framework/src/com/phonegap/DroidGap.java index 02d9332b..eb055e87 100755 --- a/framework/src/com/phonegap/DroidGap.java +++ b/framework/src/com/phonegap/DroidGap.java @@ -1118,8 +1118,19 @@ public class DroidGap extends PhonegapActivity { // our app is reloaded and restarted. All state is lost. if (this.ctx.loadInWebView || url.startsWith("file://") || url.indexOf(this.ctx.baseUrl) == 0) { try { + // Init parameters to new DroidGap activity and propagate existing parameters HashMap params = new HashMap(); params.put("loadingDialog", ""); + if (this.ctx.loadInWebView) { + params.put("loadInWebView", true); + } + params.put("keepRunning", this.ctx.keepRunning); + params.put("loadUrlTimeoutValue", this.ctx.loadUrlTimeoutValue); + String errorUrl = this.ctx.getStringProperty("errorUrl", null); + if (errorUrl != null) { + params.put("errorUrl", errorUrl); + } + this.ctx.showWebPage(url, true, false, params); } catch (android.content.ActivityNotFoundException e) { System.out.println("Error loading url into DroidGap - "+url+":"+ e.toString());