[TIMOB-3130] Android: Provide API for a TabGroup/Heavywindows/All activities in order to catch events
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-06-13T20:28:30.000+0000 |
Affected Version/s | Release 1.8.2 |
Fix Version/s | Release 1.7.0, Sprint 2011-12 |
Components | Android |
Labels | SupportTeam, klist |
Reporter | Marshall Culpepper |
Assignee | Eric Merriman |
Created | 2011-04-15T03:37:40.000+0000 |
Updated | 2017-06-13T20:28:33.000+0000 |
Description
There currently isn't a way to access the Activity object for a TabGroup
I believe I have a workaround.
Workaround
If you wait for one of the tab group's windows to open, you can use Ti.Android.currentActivity to get at the tab group's activity. For example:
In this sample, "Ti.Android.currentActivity" properly adds the event listener to the tab group's activity, and allows the "restart" event to be handled.
That having been said, it would be nice to be able to do tabGroup.activity like we can do window.activity.
Associated Helpdesk Ticket
http://developer.appcelerator.com/helpdesk/view/73401">http://developer.appcelerator.com/helpdesk/view/73401
Currently, this feature is not possible due to the kind of activity that the Tab group represents. That said, a feature request will be opened for accessing activity from the tab itself (tab.activity).
The work around that Dawson shows above set the event listener on the currently active and open tab and is the suggested method for handling this situation. As the activity changes when the tab changes, the callback needs to be set again on Ti.Android.currentActivity when the tab changes. You should also be able to set the listeners on Ti.Android.currentActivity the first time each tab opens which would negate having to set the listeners again if when the tab was selected subsequent times.
#3415 spawned for feature request
Hello, I provided Dawson's workaround to the customer, but some of the events are not working properly. The customer needs to catch all the events all activities, including tabs, heavy windows and such. BEst, Mauro
Closing ticket due to the time passed and lack of progress. Any problems, please file a new ticket.