mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
Load multi-page apps in same webview and update pause/resume for consistency.
1. Make handling of multi-page apps consistent with iOS and Blackberry to load into same webview (instead of starting a new activity). 2. Make lifecycle consistent. pause is called when going into background, resume is called when coming into foreground. It is no longer called when loading or leaving an HTML page. Use window.onload/onunload to get these notifications.
This commit is contained in:
@@ -23,13 +23,18 @@ if (typeof PhoneGap === "undefined") {
|
||||
* onDestroy Internal event fired when app is being destroyed (User should use window.onunload event, not this one).
|
||||
*
|
||||
* The only PhoneGap events that user code should register for are:
|
||||
* onDeviceReady
|
||||
* onResume
|
||||
* deviceready PhoneGap native code is initialized and PhoneGap APIs can be called from JavaScript
|
||||
* pause App has moved to background
|
||||
* resume App has returned to foreground
|
||||
*
|
||||
* Listeners can be registered as:
|
||||
* document.addEventListener("deviceready", myDeviceReadyListener, false);
|
||||
* document.addEventListener("resume", myResumeListener, false);
|
||||
* document.addEventListener("pause", myPauseListener, false);
|
||||
*
|
||||
* The DOM lifecycle events should be used for saving and restoring state
|
||||
* window.onload
|
||||
* window.onunload
|
||||
*/
|
||||
|
||||
if (typeof(DeviceInfo) !== 'object') {
|
||||
|
||||
Reference in New Issue
Block a user