[TIMOB-1178] Android: Online check results in NPE
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:55:26.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.4.0 |
Components | Android |
Labels | android, defect |
Reporter | Don Thorp |
Assignee | Don Thorp |
Created | 2011-04-15T02:45:56.000+0000 |
Updated | 2011-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.
(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...