{ "id": "64311", "key": "TIMOB-3628", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-04-19T18:54:35.000+0000", "created": "2011-04-19T18:24:31.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "1.6.1", "android", "rplist", "setactivetab", "tabGroup" ], "versions": [ { "id": "11233", "name": "Release 1.6.0", "archived": true, "released": true, "releaseDate": "2011-02-23" } ], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-09T23:18:44.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": "If you open a window inside of a tab and then call setActiveTab, the tab switches as it should behind the open window. You never see this because the open window is not hidden in the process. This can be seen in KitchenSink 'Base UI'>'Tab Groups'>'Set Active Tab(either)'.\n\nStep 1: run the code below\nStep 2: click the 'Open Child Window' button\nStep 3: click the 'Tab 2' button\nStep 4: notice that nothing happens\nStep 5: hit the back button\nStep 6: notice that the tab is changed\n\n{code:javascript}\nTitanium.UI.setBackgroundColor('#000');\n\n// create tab group\nvar tabGroup = Titanium.UI.createTabGroup();\n\n//\n// create base UI tab and root window\n//\nvar win1 = Titanium.UI.createWindow({ \n title:'Tab 1',\n backgroundColor:'#fff'\n});\nvar button1 = Ti.UI.createButton({\n\ttitle: 'Open child window'\n});\nbutton1.addEventListener('click', function(e){\n\tchildWin = Titanium.UI.createWindow({\n\t\ttitle:'Tab 1 Child',\n\t\tbackgroundColor:'#fff'\n\t});\n\t\n\tvar button2 = Ti.UI.createButton({\n\t\ttitle: 'Tab 2'\n\t});\n\tbutton2.addEventListener('click', function(e){\n\t\ttabGroup.setActiveTab(tab2);\n\t});\n\tchildWin.add(button2);\n\t\n\tTitanium.UI.currentTab.open(childWin,{animated:true});\n});\nwin1.add(button1);\n\nvar tab1 = Titanium.UI.createTab({ \n icon:'KS_nav_views.png',\n title:'Tab 1',\n window:win1\n});\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 icon:'KS_nav_ui.png',\n title:'Tab 2',\n window:win2\n});\n\nvar label2 = Titanium.UI.createLabel({\n\tcolor:'#999',\n\ttext:'I am Window 2',\n\tfont:{fontSize:20,fontFamily:'Helvetica Neue'},\n\ttextAlign:'center',\n\twidth:'auto'\n});\n\nwin2.add(label2);\n\n//\n// add tabs\n//\ntabGroup.addTab(tab1);\ntabGroup.addTab(tab2); \n\n// open tab group\ntabGroup.open();\n{code}\n\nh2.Tested On\nAndroid 2.2 Emulator, TiSDK 1.6.1\n\nh1. Associated Helpdesk Ticket\nhttp://support-admin.appcelerator.com/display/UUP-44372-885", "attachment": [], "flagged": false, "summary": "Android: setActiveTab does not switch tabs if child window opened in tab", "creator": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android 2.2 Emulator, TiSDK 1.6.1", "comment": { "comments": [ { "id": "131050", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "body": "h2. Workaround\n\nIf you close the open window(s) when you setActiveTab it will act as expected.", "updateAuthor": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-19T18:27:47.000+0000", "updated": "2011-04-19T18:27:47.000+0000" }, { "id": "131052", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is default android behavior. You must close the open window when you setActiveTab.", "updateAuthor": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-19T18:54:35.000+0000", "updated": "2011-04-19T18:54:35.000+0000" }, { "id": "410977", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T23:18:44.000+0000", "updated": "2017-03-09T23:18:44.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }