{ "id": "120192", "key": "TIMOB-15280", "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": "15691", "description": "2013 Sprint 19", "name": "2013 Sprint 19", "archived": true, "released": true, "releaseDate": "2013-09-20" }, { "id": "15693", "description": "2013 Sprint 19 API", "name": "2013 Sprint 19 API", "archived": true, "released": true, "releaseDate": "2013-09-20" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-09-20T21:04:38.000+0000", "created": "2013-09-19T09:11:22.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "Tab", "qe-closed-3.2.0", "qe-testadded", "regression", "tabgroup" ], "versions": [ { "id": "15479", "description": "Release 3.1.2", "name": "Release 3.1.2", "archived": true, "released": true, "releaseDate": "2013-07-31" } ], "issuelinks": [ { "id": "32029", "type": { "id": "10122", "name": "Gantt: start-finish", "inward": "is triggered by", "outward": "is triggering" }, "inwardIssue": { "id": "117921", "key": "TIMOB-14751", "fields": { "summary": "Android: Modal window is not getting closed", "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": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-09-26T23:05:47.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": "On SDK 3.1.0, I can close and reopen a tabgroup. On SDK 3.1.2, I can't do it any more. It's a login/logout mechanism I implement. Users can log in/log out as many times as they want.\r\n\r\nIn the sample code, click \"Log out\" to close the tab group. Click \"Log in\" to reopen the tab group. You'll see you can do this on 3.1.0, but not 3.1.2.\r\n\r\nWe are about to release this app, so it's kind of urgent. If possible, please fix it or provide a workaround asap (without changing this mechanism too much). Thank you.\r\n{code}\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\n\r\nvar tab1 = Titanium.UI.createTab({ \r\n title:'Tab 1',\r\n window:win1\r\n});\r\n\r\nvar btn = Ti.UI.createButton({title:'Log out'});\r\nbtn.addEventListener('click',function(){\r\n tabGroup.close();\r\n});\r\nwin1.add(btn);\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\nvar tab2 = Titanium.UI.createTab({ \r\n title:'Tab 2',\r\n window:win2\r\n});\r\n\r\nvar label2 = Titanium.UI.createLabel({\r\n color:'#999',\r\n text:'I am Window 2',\r\n font:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n textAlign:'center',\r\n width:'auto'\r\n});\r\n\r\nwin2.add(label2);\r\n\r\n//\r\n// add tabs\r\n//\r\ntabGroup.addTab(tab1); \r\ntabGroup.addTab(tab2); \r\n\r\nvar loginWin = Ti.UI.createWindow({exitOnClose:true,navBarHidden:false,title:'Login'});\r\nbtn2 = Ti.UI.createButton({title:'Log in'});\r\nloginWin.add(btn2);\r\nloginWin.addEventListener('click',function(){\r\n tabGroup.open();\r\n});\r\nloginWin.open();\r\nloginWin.addEventListener('open',function(){\r\n tabGroup.open();\r\n});\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: can't reopen tab group", "creator": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "environment": null, "comment": { "comments": [ { "id": "272009", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "There is a bug in the tabgroup.close() method even before 3.1.2.GA. I attached a modified test case below. By running that test case with 3.1.1.GA, we can see the tabgroup's \"open\" event is fired but no \"close\" event is fired after clicking the \"Log out\" button. This bug will eventually lead to a memory leak.\nAfter we fixed TIMOB-14751, this bug is exposed. Since the tabgroup does not fire the \"close\" event, we don't allow it to open again. That's why the tabgroup can not reopen.\n{code}\nvar tabGroup = Titanium.UI.createTabGroup();\n \n \n//\n// create base UI tab and root window\n//\nvar win1 = Titanium.UI.createWindow({ \n title:'Tab 1',\n backgroundColor:'#fff'\n});\n \nvar tab1 = Titanium.UI.createTab({ \n title:'Tab 1',\n window:win1\n});\n \nvar btn = Ti.UI.createButton({title:'Log out'});\nbtn.addEventListener('click',function(){\n tabGroup.close();\n});\nwin1.add(btn);\n \n//\n// create controls tab and root window\n//\nvar win2 = Titanium.UI.createWindow({ \n title:'Tab 2',\n backgroundColor:'#fff'\n});\nvar tab2 = Titanium.UI.createTab({ \n title:'Tab 2',\n window:win2\n});\n \nvar label2 = Titanium.UI.createLabel({\n color:'#999',\n text:'I am Window 2',\n font:{fontSize:20,fontFamily:'Helvetica Neue'},\n textAlign:'center',\n width:'auto'\n});\n \nwin2.add(label2);\n \n//\n// add tabs\n//\ntabGroup.addTab(tab1); \ntabGroup.addTab(tab2);\n\ntabGroup.addEventListener(\"open\", function(){\n\tTi.API.info(\"********************* tabGroup open\");\n});\ntabGroup.addEventListener(\"close\", function(){\n\tTi.API.info(\"********************* tabGroup close\");\n});\n \nvar loginWin = Ti.UI.createWindow({exitOnClose:true,navBarHidden:false,title:'Login'});\nbtn2 = Ti.UI.createButton({title:'Log in'});\nloginWin.add(btn2);\nloginWin.addEventListener('click',function(){\n tabGroup.open();\n});\nloginWin.open();\nloginWin.addEventListener('open',function(){\n tabGroup.open();\n});\n{code}", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-19T21:19:03.000+0000", "updated": "2013-09-19T21:19:03.000+0000" }, { "id": "272011", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/4716", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-19T21:21:57.000+0000", "updated": "2013-09-19T21:21:57.000+0000" }, { "id": "273082", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and verified the ability to log in/log out as many times as I want\nAppcelerator Studio, build: 3.1.3.201309132456\nTitanium SDK 3.2.0.v20130926123242\nCLI 3.2.0\nDevices:\nNexus7 Android version 4.3\nNexus4 Android version 4.3", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-26T23:02:57.000+0000", "updated": "2013-09-26T23:02:57.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }