{ "id": "63762", "key": "TIMOB-3130", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "11247", "name": "Sprint 2011-12", "archived": true, "released": true, "releaseDate": "2011-03-28" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-06-13T20:28:30.000+0000", "created": "2011-04-15T03:37:40.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "SupportTeam", "klist" ], "versions": [ { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-06-13T20:28:33.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": "{html}
There currently isn't a way to access the Activity object for a\r\nTabGroup
I believe I have a workaround.
\nIf you wait for one of the tab group's windows to open, you can\nuse Ti.Android.currentActivity to get at the tab group's activity.\nFor example:
\n\nvar tabGroup = Ti.UI.createTabGroup();\nvar tmpWindow = Ti.UI.createWindow();\ntabGroup.addTab(Ti.UI.createTab({ window: tmpWindow }));\ntabGroup.addTab(Ti.UI.createTab({ window: Ti.UI.createWindow() }));\ntabGroup.open();\n\ntmpWindow.addEventListener('open', function() {\n Ti.Android.currentActivity.addEventListener('restart', function() {\n alert('Restarted!');\n });\n alert('Opened!');\n});
\n
\nIn this sample, \"Ti.Android.currentActivity\" properly adds the\nevent listener to the tab group's activity, and allows the\n\"restart\" event to be handled.
\nThat having been said, it would be nice to be able to do\ntabGroup.activity like we can do window.activity.
\nCurrently, this feature is not possible due to the kind of\nactivity that the Tab group represents. That said, a feature\nrequest will be opened for accessing activity from the tab itself\n(tab.activity).
\nThe work around that Dawson shows above set the event listener\non the currently active and open tab and is the suggested method\nfor handling this situation. As the activity changes when the tab\nchanges, the callback needs to be set again on\nTi.Android.currentActivity when the tab changes. You should also be\nable to set the listeners on Ti.Android.currentActivity the first\ntime each tab opens which would negate having to set the listeners\nagain if when the tab was selected subsequent times.
\n#3415 spawned for feature request