{ "id": "78787", "key": "TIMOB-4897", "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": "12075", "description": "", "name": "Sprint 2011-35", "archived": true, "released": true, "releaseDate": "2011-09-05" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-08-31T14:54:31.000+0000", "created": "2011-08-05T05:45:22.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "11570", "description": "", "name": "Release 1.7.2", "archived": true, "released": true, "releaseDate": "2011-07-21" } ], "issuelinks": [ { "id": "12400", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "inwardIssue": { "id": "78310", "key": "MOD-149", "fields": { "summary": "Android Barcode not receiving Event Listeners", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2014-06-19T12:46:34.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 have confirmed that the issue occurs simply by adding 'navBarHidden:false' to the window creation. If you comment out the setting of the navBarHidden property then the event listeners work.\r\n\r\nThe sample below is excerpted from MOD-149. You should be able to just take the sample in the barcode module and add the navBarHidden property to the window creation. \r\n\r\nAndroid Barcode module not receiving event listeners. Use sample code for testing:\r\n{code:title=app.js}\r\n\r\nvar window = Ti.UI.createWindow({\r\n backgroundColor: 'white',\r\n layout: 'vertical',\r\n navBarHidden:false,\r\n exitOnClose:true\r\n\t \r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n title: 'Scan Code',\r\n width: 150, \r\n height: 60,\r\n top: 20\r\n});\r\nwindow.add(button);\r\n\r\n\t\r\nwindow.add(Ti.UI.createLabel({\r\n text: 'You may need to rotate the device',\r\n top: 10,\r\n height: 'auto', width: 'auto',\r\n font: { fontSize: 12 }\r\n}));\r\n\r\nwindow.add(Ti.UI.createLabel({\r\n\ttext: 'Result:',\r\n\ttop:10,\r\n\tleft:10,\r\n\ttextAlign: 'left',\r\n\tcolor:'black',\r\n\tfont: {fontSize:18, fontStyle:'bold'},\r\n\theight:'auto'\r\n}));\r\n\r\nvar scanResult = Ti.UI.createLabel({\r\n\ttext: '',\r\n\ttop:10,\r\n\tleft:10,\r\n\ttextAlign: 'left',\r\n\tcolor:'black',\r\n\theight:'auto'\r\n});\r\nwindow.add(scanResult);\r\n\r\nwindow.add(Ti.UI.createLabel({\r\n\ttext: 'Content Type:',\r\n\ttop:10,\r\n\tleft:10,\r\n\ttextAlign: 'left',\r\n\tcolor:'black',\r\n\tfont: {fontSize:18, fontStyle:'bold'},\r\n\theight:'auto'\r\n}));\r\n\r\nvar scanContentType = Ti.UI.createLabel({\r\n\ttext: '',\r\n\ttop:10,\r\n\tleft:10,\r\n\ttextAlign: 'left',\r\n\tcolor:'black',\r\n\theight:'auto'\r\n});\r\nwindow.add(scanContentType);\r\n\r\nwindow.add(Ti.UI.createLabel({\r\n\ttext: 'Format:',\r\n\ttop:10,\r\n\tleft:10,\r\n\ttextAlign: 'left',\r\n\tcolor:'black',\r\n\tfont: {fontSize:18, fontStyle:'bold'},\r\n\theight:'auto'\r\n}));\r\n\r\nvar scanFormat = Ti.UI.createLabel({\r\n\ttext: '',\r\n\ttop:10,\r\n\tleft:10,\r\n\ttextAlign: 'left',\r\n\tcolor:'black',\r\n\theight:'auto'\r\n});\r\nwindow.add(scanFormat);\r\n\r\nwindow.open();\r\n\r\nTitanium.Barcode = Ti.Barcode = require('ti.barcode');\r\n\r\nbutton.addEventListener('click', function() {\r\n\tTi.Barcode.capture();\r\n});\r\n\r\nTi.Barcode.addEventListener('error', function(e) {\r\n\tscanResult.text = e.message;\r\n\tscanContentType.text = '';\r\n\tscanFormat.text = '';\r\n});\r\n\r\nTi.Barcode.addEventListener('canceled', function(e) {\r\n\tscanResult.text = e.message;\r\n\tscanContentType.text = '';\r\n\tscanFormat.text = '';\r\n});\r\n\r\nTi.Barcode.addEventListener('success', function(e) {\r\n\tscanResult.text = e.result;\r\n\tscanContentType.text = e.contentType;\r\n\tscanFormat.text = e.format;\r\n\talert(\"result: \"+e.result);\r\n});\r\n\r\n{code}\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: Setting navBarHidden:false in window creation causes event listeners on a module to stop working", "creator": { "name": "jenglish", "key": "jenglish", "displayName": "Jeff English", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "jenglish", "key": "jenglish", "displayName": "Jeff English", "active": true, "timeZone": "America/Chicago" }, "environment": "Tested on Android 2.2, Titanium 1.7.2", "comment": { "comments": [ { "id": "164665", "author": { "name": "jenglish", "key": "jenglish", "displayName": "Jeff English", "active": true, "timeZone": "America/Chicago" }, "body": "Updated module source to retrieve activity from KrollInvocation. No change required in core platform.", "updateAuthor": { "name": "jenglish", "key": "jenglish", "displayName": "Jeff English", "active": true, "timeZone": "America/Chicago" }, "created": "2011-08-31T14:54:32.000+0000", "updated": "2011-08-31T14:54:32.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }