callback/callback-android — Issue #35: On application start, offline event is triggered for connected device.
Author: macdonst
Created: 2011-11-25 19:51:08+00:00
State: open

We are using Phonegap 1.0 and have been doing some testing of our application on an LG Thrill which runs Android 2.2.2.

We attach to the 'offline' event as described in the phonegap documentation but intermittently we receive the offline event on app start and never receive the online event after.

As a temporary fix we do this:

```javascript
document.addEventListener("offline", function(){
setTimeout(function(){
networkState = navigator.network.connection.type;
if(networkState == Connection.UNKNOWN || networkState == Connection.NONE) {
tcApp.setOffline();
}
}, 3000);
}, false);
```

We basically now listen for your event and delay our action for 3 seconds so that we can ask you for your final answer.

Expectation:
When the app loads, we only get an offline event if the phone has no network connectivity.