Problem description
The event 'resume' is not fired when the application is using TabGroup.
Steps to reproduce
Use the following code:
var tabGroup = Ti.UI.createTabGroup();
var win = Ti.UI.createWindow({
backgroundColor: 'red'
});
var tab = Ti.UI.createTab({
window: win,
title: 'Test'
});
tabGroup.addTab(tab);
tabGroup.open();
tabGroup.addEventListener('open',function(){
Ti.API.info("##### Adding resume listener #####");
var activity = Ti.Android.currentActivity;
activity.addEventListener('resume', function(e) {
Ti.API.info("##### Resumed #####");
});
});
The resume listener is never fired (tested on Nexus 4). If I replace the tabgroup with a simple window, it works.
The resume fires if the listener is added to tab.getActicity(): ~~~ tabgroup.getActivity().addEventListener('resume', function(e) { // code here }); ~~~ However, there seem to be a problem with the extra data. See TIMOB-14139
Ti.Android.currentActivity isn't giving us the tabGroup activity, but the root activity instead. This is because Ti.Android.currentActivity will always return the first activity of the current context. Basically in our case, since there is only one context, currentActivity is set initially when the root activity is created. If you open a window using 'url', Ti.Android.currentActivity will change. Tabgroup.getActivity() should be used instead.
Closing ticket as the issue will not fix.