{ "id": "91486", "key": "TIMOB-9108", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13418", "description": "Sprint 2012-13 Core", "name": "Sprint 2012-13 Core", "archived": true, "released": true, "releaseDate": "2012-07-01" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-07-11T03:57:22.000+0000", "created": "2012-05-07T12:43:20.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "core", "module_network", "qe-testadded", "regression" ], "versions": [ { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "issuelinks": [], "assignee": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-03-13T17:45:14.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "I recently updated from Titanium SDK 1.7x to 1.8.2. The Network change listener does not work anymore.\r\n\r\nTi.Network.addEventListener(\"change\",function(e) {\r\n Titanium.API.debug(\"Network changed\");\r\n if (Titanium.Network.online) {\r\n Titanium.API.debug(\"Network is available\"); \r\n }\r\n});\r\n\r\nUnder 1.7.5 the log messages are printed, in 1.8.2 (and the most recent 1.8.3) it stopped working. I'm testing on an HTC Disre HD with Android 2.3.5. I was able to recreate it with above code added to the simplest test application", "attachment": [ { "id": "27568", "filename": "app.js", "author": { "name": "goergen", "key": "goergen", "displayName": "Daniel", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-07T12:43:20.000+0000", "size": 1416, "mimeType": "application/x-javascript" }, { "id": "28528", "filename": "log.rtf", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-19T17:28:16.000+0000", "size": 491921, "mimeType": "text/rtf" } ], "flagged": false, "summary": "Android: Network change listener does not fire", "creator": { "name": "goergen", "key": "goergen", "displayName": "Daniel", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "goergen", "key": "goergen", "displayName": "Daniel", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "mobile SDK 1.8.2 and 1.8.3 (18.04)\r\nAndroid 2.3.5 on HTC Desire HD", "comment": { "comments": [ { "id": "196108", "author": { "name": "azazel", "key": "azazel", "displayName": "Alberto Berti", "active": true, "timeZone": "America/Los_Angeles" }, "body": "i have the same issue", "updateAuthor": { "name": "azazel", "key": "azazel", "displayName": "Alberto Berti", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-25T10:21:47.000+0000", "updated": "2012-05-25T10:21:47.000+0000" }, { "id": "199010", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Sent [PR #2423|https://github.com/appcelerator/titanium_mobile/pull/2423] to resolve issue.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-18T16:38:01.000+0000", "updated": "2012-06-18T16:38:01.000+0000" }, { "id": "199269", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "With SDK 2.1.0.v20120618154152, I was unable to get the event to fire. I tried on two devices (one without cell capability) and saw many indications in the log of the network change, but not the target text from the sample code. See attached log.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-19T17:27:48.000+0000", "updated": "2012-06-19T17:27:48.000+0000" }, { "id": "199405", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Eric, I was able to test this fine by turning the wifi on the device on/off.\r\nThe device also had no cellular network capabilities. Could you provide steps to reproduce\r\nthe failure you saw on this ticket? I know you talked about it yesterday, but if you could refresh\r\nmy memory and also keep a record here for others.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-20T13:14:37.000+0000", "updated": "2012-06-20T13:14:37.000+0000" }, { "id": "199508", "author": { "name": "kangae2", "key": "kangae2", "displayName": "Satoshi Tanaka", "active": true, "timeZone": "Asia/Tokyo" }, "body": "I tested my Android, network change event fired correctly.\r\nBut Ti.Network.NETWORK_WIFI is null, so below code doesn't work.\r\n\r\nTi.Network.addEventListener('change', function(e)\r\n{\r\n if(Ti.Network.networkType == Ti.Network.NETWORK_WIFI) {\r\n Ti.API.info(\"Network changed to Wi-Fi!\");\r\n }\r\n});\r\n\r\n\r\n", "updateAuthor": { "name": "kangae2", "key": "kangae2", "displayName": "Satoshi Tanaka", "active": true, "timeZone": "Asia/Tokyo" }, "created": "2012-06-20T19:26:26.000+0000", "updated": "2012-06-20T19:26:26.000+0000" }, { "id": "199510", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Satoshi, could you please open a new issue for that property being null.\r\nI imagine the other NETWORK_ constants are null as well.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-20T19:31:28.000+0000", "updated": "2012-06-20T19:31:28.000+0000" }, { "id": "199519", "author": { "name": "kangae2", "key": "kangae2", "displayName": "Satoshi Tanaka", "active": true, "timeZone": "Asia/Tokyo" }, "updateAuthor": { "name": "kangae2", "key": "kangae2", "displayName": "Satoshi Tanaka", "active": true, "timeZone": "Asia/Tokyo" }, "created": "2012-06-20T22:15:23.000+0000", "updated": "2012-06-20T22:15:23.000+0000" }, { "id": "199753", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Josh, just following-up from our conversation. Seems as though when I disabled the access point, the device switched to another access point. This may have prevented the listener from firing. I will attempt to verify this ticket again tomorrow.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-22T10:16:48.000+0000", "updated": "2012-06-22T10:16:48.000+0000" }, { "id": "200390", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cannot reproduce on GalaxyTab with 2.1.0 RC", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-26T14:01:58.000+0000", "updated": "2012-06-26T14:10:27.000+0000" }, { "id": "200394", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Fixed by PR https://github.com/appcelerator/titanium_mobile/pull/2423", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-26T14:11:37.000+0000", "updated": "2012-06-26T14:11:37.000+0000" }, { "id": "200399", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed with SDK 2.1.0.v20120626130259 using the following code:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#ccc'\r\n});\r\n \r\nvar table = Ti.UI.createTableView();\r\n \r\nwin.add(table);\r\n \r\nvar data = [];\r\nfor(var i = 0; i < 50; i++){\r\n data.push({ title:'Row #'+i });\r\n}\r\ntable.setData(data);\r\n \r\nwin.open();\r\n\r\nTi.Network.addEventListener(\"change\",function(e) {\r\nTitanium.API.debug(\"Network changed\");\r\nsetTimeout(function() {\r\nalert(\"Network changed (available=\"+Titanium.Network.online+\")\");\r\n},100);\r\nif (Titanium.Network.online) { Titanium.API.debug(\"Network is available\"); }\r\n});\r\n{code}", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-26T14:21:47.000+0000", "updated": "2012-06-26T14:21:47.000+0000" }, { "id": "202622", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Re-opening to edit label", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-11T03:56:48.000+0000", "updated": "2012-07-11T03:56:48.000+0000" }, { "id": "281107", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Anvil test case added.\nPR link:\nhttps://github.com/appcelerator/titanium_mobile/pull/5011", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-25T08:23:05.000+0000", "updated": "2013-11-25T08:23:05.000+0000" } ], "maxResults": 13, "total": 13, "startAt": 0 } } }