0

why Phonegap on Android is firing both events (deviceready,resume) when I call navigator.app.loadUrl() ????

Im using cordova-1.5.0 on Android.

The page being called by loadUrl() has this javaScript:

<head>
<script type="text/javascript">
 function onDeviceReady() {
    alert('Ready');
}

function onLoad() {
    alert('onLoad');
    document.addEventListener("deviceready", onDeviceReady, false);
    document.addEventListener("resume", onResume, false);

}

function onResume() {
    alert('OnResume');   
}

</script>
</head>
<body onload="onLoad();">

I tried to use href.location but that way "deviceready" is not called.

Any help?

Thanks

Hazneliel
  • 531
  • 1
  • 5
  • 16

2 Answers2

0

It's called but not showing message box. Try to replay alert with

navigator.notification.alert("Ready");
judgement
  • 437
  • 3
  • 12
0

There was a bug in that release of Cordova, it was fixed

Hazneliel
  • 531
  • 1
  • 5
  • 16