From fb2c25c6c6b780c372efb11764ed45f362cd34d4 Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Mon, 7 Mar 2011 16:48:23 -0800 Subject: [PATCH] Issue 107: Always send pause event to JS. --- framework/src/com/phonegap/DroidGap.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/framework/src/com/phonegap/DroidGap.java b/framework/src/com/phonegap/DroidGap.java index 8829dfee..3c8cd7b1 100755 --- a/framework/src/com/phonegap/DroidGap.java +++ b/framework/src/com/phonegap/DroidGap.java @@ -600,16 +600,15 @@ public class DroidGap extends PhonegapActivity { */ protected void onPause() { super.onPause(); - + // Send pause event to JavaScript + this.appView.loadUrl("javascript:try{PhoneGap.onPause.fire();}catch(e){};"); + // If app doesn't want to run in background if (!this.keepRunning) { // Forward to plugins this.pluginManager.onPause(); - // Send pause event to JavaScript - this.appView.loadUrl("javascript:try{PhoneGap.onPause.fire();}catch(e){};"); - // Pause JavaScript timers (including setInterval) this.appView.pauseTimers(); }