Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1178] Android: Online check results in NPE

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:55:26.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.4.0
ComponentsAndroid
Labelsandroid, defect
ReporterDon Thorp
AssigneeDon Thorp
Created2011-04-15T02:45:56.000+0000
Updated2011-04-17T01:55:26.000+0000

Description

There is a race condition where checking online state was can be called before the Activity used to get the ConnectionManager is available. Since a specific Context is not required to look up the service. Use the Application as the Context instead of the Activity.

Comments

  1. Don Thorp 2011-04-15

    (from [cdda68078dd2fc441889acf10ce0967b6a974533]) [#1178 state:resolved] Use the Application object as the Context when retrieving the ConnectionManager. Have TiContext hold a reference to the application instead of querying it each time. http://github.com/appcelerator/titanium_mobile/commit/cdda68078dd2fc441889acf10ce0967b6a974533"> http://github.com/appcelerator/titanium_mobile/commit/cdda68078dd2f...

JSON Source