You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Andrew Grieve (JIRA)" <ji...@apache.org> on 2012/09/18 22:03:07 UTC

[jira] [Resolved] (CB-1269) navigator.onLine and related events never fire on Android

     [ https://issues.apache.org/jira/browse/CB-1269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Grieve resolved CB-1269.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2.0

Fixed by commit: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=commit;h=b25e91d5f900c19680fdddc522c04b6d854b2032
                
> 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
>             Fix For: 2.2.0
>
>
> 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
For more information on JIRA, see: http://www.atlassian.com/software/jira