{ "id": "98852", "key": "TIMOB-10338", "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": "14065", "description": "Sprint 2012-17 API", "name": "Sprint 2012-17 API", "archived": true, "released": true, "releaseDate": "2012-08-27" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-08-21T16:45:37.000+0000", "created": "2012-08-08T07:13:40.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api", "module_tabgroup", "qe-review", "qe-testadded" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13572", "description": "Release 2.1.1", "name": "Release 2.1.1", "archived": true, "released": true, "releaseDate": "2012-07-31" } ], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-09-10T03:55:24.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": "h3. Problem\r\n\r\nWhen closing a tab group followed by creating and opening a new tab group, the application crashes.\r\n\r\nh3. Steps to reproduce\r\n\r\n1. The app starts and the first tab group is opened\r\n2. Click on the button to close the first tab group and create and open another tab group\r\n3. Application crashes\r\n\r\nh3. Code to reproduce\r\n\r\n{code}\r\nvar rootWin = Ti.UI.createWindow({\r\n\tbackgroundColor : 'pink',\r\n\texitOnClose : true,\r\n\tnavBarHidden : true\r\n});\r\n\r\nrootWin.open();\r\n\r\nvar tabGroup = Ti.UI.createTabGroup();\r\n\r\nvar win1 = Ti.UI.createWindow({\r\n\tbackgroundColor : 'orange'\r\n});\r\n\r\n\r\nvar aButton = Ti.UI.createButton({\r\n\ttitle : 'Button',\r\n\theight : Ti.UI.SIZE,\r\n\twidth : Ti.UI.SIZE\r\n});\r\n\r\n\r\naButton.addEventListener('click', function() {\r\n\r\n\ttabGroup.close();\r\n\ttabGroup = null;\r\n\r\n\tvar tabGroup2 = Ti.UI.createTabGroup();\r\n\r\n\tvar win21 = Ti.UI.createWindow({\r\n\t\tbackgroundColor : 'orange'\r\n\t});\r\n\r\n\tvar tab21 = Ti.UI.createTab({\r\n\t\twindow : win21\r\n\t});\r\n\r\n\ttabGroup2.addTab(tab21);\r\n\r\n\ttabGroup2.open();\r\n});\r\n\r\nwin1.add(aButton);\r\n\r\nvar win2 = Ti.UI.createWindow({\r\n\tbackgroundColor : 'lime'\r\n});\r\n\r\nvar tab1 = Ti.UI.createTab({\r\n\twindow : win1\r\n});\r\nvar tab2 = Ti.UI.createTab({\r\n\twindow : win2\r\n});\r\n\r\ntabGroup.addTab(tab1);\r\ntabGroup.addTab(tab2);\r\n\r\ntabGroup.open();\r\n\r\n{code}\r\n\r\nh3. Expected behavior \r\n\r\nFirst tab group is closed and new tab group is opened.\r\n\r\nh3. Actual behavior\r\n\r\nApplication crashes \r\n\r\n\r\n\r\n\r\nPlease find attached the crash log.", "attachment": [ { "id": "30349", "filename": "log.txt", "author": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-08T07:14:43.000+0000", "size": 17890, "mimeType": "text/plain" } ], "flagged": false, "summary": "Android: Opening a new tab group after closing a tab group crashes the application", "creator": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK 2.1.1 and 2.1.0\r\nAndroid 2.3.4\r\n", "comment": { "comments": [ { "id": "214923", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "body": "Window open is an asynchronous operation and it is not safe to assume that the Tab Group will not be opened as the root activity for the task. Both the window and tab group are basically in a race to be the root activity. If a true chaining is desired (first window then tab group), it is possible to open the tab group once the window has been opened via open event listener. The default behavior of the application should be to exit when the root activity is closed. ", "updateAuthor": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2012-08-16T20:41:44.000+0000", "updated": "2012-08-16T20:46:11.000+0000" }, { "id": "218139", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified on:\r\nSDK: 2.2.0.v20120907162025\r\nSTUDIO: 2.1.3.201209071738\r\nDevices: Samsung galaxy note(v 2.3.6), iOS simulator\r\n\r\nAccording to Opie Cyrus comment,tab group is opened after window is opened via open event listener. Following code is being used to test the scenario:\r\n\r\n\r\nvar rootWin = Ti.UI.createWindow({\r\n backgroundColor : 'pink',\r\n exitOnClose : true,\r\n navBarHidden : true\r\n});\r\n \r\n\r\n \r\n rootWin.addEventListener('open', function(e)\r\n {\r\n \r\n var tabGroup = Ti.UI.createTabGroup();\r\n \r\nvar win1 = Ti.UI.createWindow({\r\n backgroundColor : 'orange'\r\n});\r\n \r\n \r\nvar aButton = Ti.UI.createButton({\r\n title : 'Button',\r\n height : Ti.UI.SIZE,\r\n width : Ti.UI.SIZE\r\n});\r\n \r\n \r\naButton.addEventListener('click', function() {\r\n \r\n tabGroup.close();\r\n tabGroup = null;\r\n \r\n var tabGroup2 = Ti.UI.createTabGroup();\r\n \r\n var win21 = Ti.UI.createWindow({\r\n backgroundColor : 'orange'\r\n });\r\n \r\n var tab21 = Ti.UI.createTab({\r\n window : win21\r\n });\r\n \r\n tabGroup2.addTab(tab21);\r\n \r\n tabGroup2.open();\r\n});\r\n \r\nwin1.add(aButton);\r\n \r\nvar win2 = Ti.UI.createWindow({\r\n backgroundColor : 'lime'\r\n});\r\n \r\nvar tab1 = Ti.UI.createTab({\r\n window : win1\r\n});\r\nvar tab2 = Ti.UI.createTab({\r\n window : win2\r\n});\r\n \r\ntabGroup.addTab(tab1);\r\ntabGroup.addTab(tab2);\r\n \r\ntabGroup.open();\r\n\r\n });\r\nrootWin.open();\r\n", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-10T03:55:24.000+0000", "updated": "2012-09-10T03:55:24.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }