Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13979] Android: activity resume not fired when using TabGroup

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2013-06-20T21:49:53.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 13 API, 2013 Sprint 13
ComponentsAndroid
LabelsSupportTeam
ReporterDavide Cassenti
AssigneeHieu Pham
Created2013-05-24T13:28:09.000+0000
Updated2017-03-20T18:05:01.000+0000

Description

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.

Comments

  1. Davide Cassenti 2013-06-06

    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
  2. Hieu Pham 2013-06-20

    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.
  3. Lee Morris 2017-03-20

    Closing ticket as the issue will not fix.

JSON Source