Issue 107: Always send pause event to JS.

This commit is contained in:
Fil Maj 2011-03-07 16:48:23 -08:00
parent 47ca081f36
commit fb2c25c6c6

View File

@ -600,6 +600,8 @@ 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) {
@ -607,9 +609,6 @@ public class DroidGap extends PhonegapActivity {
// 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();
}