Andrew Grieve created CB-1269:
---------------------------------
Summary: navigator.onLine and related events never fire on Android
Key: CB-1269
URL: https://issues.apache.org/jira/browse/CB-1269
Project: Apache Cordova
Issue Type: Bug
Components: Android
Affects Versions: 2.0.0
Reporter: Andrew Grieve
Assignee: Andrew Grieve
Discovered this when doing bridge testing.
function onLineEvent2(e) {
console.log('Got online=' + navigator.onLine);
}
window.addEventListener('online', onLineEvent2, false);
window.addEventListener('offline', onLineEvent2, false);
The events never fire when I put my phone in and out of airplane mode. I see
the following log:
08-21 13:20:14.095: D/DroidGap(12652): onMessage(networkconnection,none)
But never get an online/offline event.
If I use setNetworkAvailable() manually, the events get fired as a result. This
leads me to believe that it's the app's responsibility to call this setter in
order for the events to be fired.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira