mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
Don't fire resume upon init - only when returning from background.
Lifecycle behavior for PhoneGap app: window.onload = loading html page pause = html page entering background (not displayed) resume = html page entering foreground (displayed) window.onunload = leaving html page
This commit is contained in:
@@ -730,7 +730,7 @@ public class DroidGap extends PhonegapActivity {
|
||||
}
|
||||
|
||||
// Send pause event to JavaScript
|
||||
this.appView.loadUrl("javascript:try{PhoneGap.onPause.fire();}catch(e){};");
|
||||
this.appView.loadUrl("javascript:try{PhoneGap.fireDocumentEvent('pause');}catch(e){};");
|
||||
|
||||
// Forward to plugins
|
||||
this.pluginManager.onPause(this.keepRunning);
|
||||
@@ -771,7 +771,7 @@ public class DroidGap extends PhonegapActivity {
|
||||
}
|
||||
|
||||
// Send resume event to JavaScript
|
||||
this.appView.loadUrl("javascript:try{PhoneGap.onResume.fire();}catch(e){};");
|
||||
this.appView.loadUrl("javascript:try{PhoneGap.fireDocumentEvent('resume');}catch(e){};");
|
||||
|
||||
// Forward to plugins
|
||||
this.pluginManager.onResume(this.keepRunning || this.activityResultKeepRunning);
|
||||
|
||||
@@ -239,7 +239,6 @@ public final class PluginManager {
|
||||
this.plugins.put(className, plugin);
|
||||
plugin.setContext(this.ctx);
|
||||
plugin.setView(this.app);
|
||||
plugin.onResume(true);
|
||||
return plugin;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user