{ "id": "88389", "key": "AC-2778", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2012-03-28T16:05:12.000+0000", "created": "2012-03-21T12:53:17.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:47:41.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "The open event is not firing reliably. Here's a summary of what happens on each platform:\r\n\r\niOS: win1 open event fires when the app opens, win2 open event fires when you switch to it's tab\r\nAndroid Ti 1.8.1: no open events fire\r\nAndroid Ti 1.8.2: no open events fire\r\nAndroid Ti 2.0 CI: win1 open event fires when the app opens, win2 open event never fires\r\n\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\n// create tab group\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n\r\n\r\n//\r\n// create base UI tab and root window\r\n//\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\nwin1.addEventListener('open',function(){\r\n\talert('win1 opened');\r\n});\r\nvar tab1 = Titanium.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Tab 1',\r\n window:win1\r\n});\r\n\r\nvar label1 = Titanium.UI.createLabel({\r\n\tcolor:'#999',\r\n\ttext:'I am Window 1',\r\n\tfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n\ttextAlign:'center',\r\n\twidth:'auto'\r\n});\r\n\r\nwin1.add(label1);\r\n\r\n//\r\n// create controls tab and root window\r\n//\r\nvar win2 = Titanium.UI.createWindow({ \r\n title:'Tab 2',\r\n backgroundColor:'#fff'\r\n});\r\nwin2.addEventListener('open',function(){\r\n\talert('win2 opened'); // this event does not fire on Android\r\n});\r\nvar tab2 = Titanium.UI.createTab({ \r\n icon:'KS_nav_ui.png',\r\n title:'Tab 2',\r\n window:win2\r\n});\r\n\r\nvar label2 = Titanium.UI.createLabel({\r\n\tcolor:'#999',\r\n\ttext:'I am Window 2',\r\n\tfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n\ttextAlign:'center',\r\n\twidth:'auto'\r\n});\r\n\r\nwin2.add(label2);\r\n\r\n\r\n\r\n//\r\n// add tabs\r\n//\r\ntabGroup.addTab(tab1); \r\ntabGroup.addTab(tab2); \r\n\r\n\r\n// open tab group\r\ntabGroup.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: window open events are not firing when windows belong to tabs", "creator": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "environment": "Ti 1.8.1, 1.8.2, 2.0 CI, Android 4 on Galaxy Nexus", "comment": { "comments": [ { "id": "188153", "author": { "name": "mark.ruys@in2sports.net", "key": "mark.ruys@in2sports.net", "displayName": "Mark Ruys", "active": true, "timeZone": "Europe/Berlin" }, "body": "I experience the same problematic behavior. \r\n\r\nWork around is to capture the windows focus event and use a boolean to make sure your code is run only once.", "updateAuthor": { "name": "mark.ruys@in2sports.net", "key": "mark.ruys@in2sports.net", "displayName": "Mark Ruys", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-03-23T05:01:17.000+0000", "updated": "2012-03-23T05:01:17.000+0000" }, { "id": "188161", "author": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "updateAuthor": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "created": "2012-03-23T05:54:40.000+0000", "updated": "2012-03-23T05:54:40.000+0000" }, { "id": "189074", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2012-03-28T16:05:12.000+0000", "updated": "2012-03-28T16:05:12.000+0000" }, { "id": "280913", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Closing since it's a dup. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-11-24T22:07:45.000+0000", "updated": "2013-11-24T22:07:45.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }