Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4079] Android: setInterval won't fire in app.js with TabGroup

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-11-05T13:48:36.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sSprint 2011-26, Release 1.7.2, Release 1.8.0
ComponentsAndroid
Labelsn/a
ReporterJon Alter
AssigneeBill Dawson
Created2011-05-13T12:21:33.000+0000
Updated2011-11-05T13:48:36.000+0000

Description

The following example will not fire setInterval. Works fine if you replace the TabGroup with a Window.
	var tabGroup = Titanium.UI.createTabGroup();
    var win1 = Titanium.UI.createWindow({
        title:'Tab 1',
        backgroundColor:'#fff'    
    });
    var tab1 = Titanium.UI.createTab({
        icon:'KS_nav_views.png',
        title:'Tab 1',
        window:win1
    });
    var label1 = Titanium.UI.createLabel({
        color:'#999',
        text:'I am Window 1',
        font:{fontSize:20,fontFamily:'Helvetica Neue'},
        textAlign:'center',
        width:'auto'
    });
    win1.add(label1);

    var win2 = Titanium.UI.createWindow({
        title:'Tab 2',
        backgroundColor:'#fff'
    });
    var tab2 = Titanium.UI.createTab({
        icon:'KS_nav_ui.png',
        title:'Tab 2',
        window:win2
    });
    var label2 = Titanium.UI.createLabel({
        color:'#999',
        text:'I am Window 2',
        font:{fontSize:20,fontFamily:'Helvetica Neue'},
        textAlign:'center',
        width:'auto'
    });
    win2.add(label2);

    tabGroup.addTab(tab1);
    tabGroup.addTab(tab2);
    
    setInterval(function() {
	Ti.API.info('timer fired!');
    }, 2000);

    tabGroup.open();

Tested On

TiSDK 1.7.0 (05/12/11 16:26 844218f...), Android Simulator 2.3

Comments

  1. Jon Alter 2011-05-13

    Associated Helpdesk Ticket

    http://appc.me/c/APP-938779
  2. Don Thorp 2011-05-18

    Inspection around this issue reveal several cases where timers aren't working as we would like. We need to review this with iOS in 1.7.1 and potentially stop managing timers for the app except when an app is exited.
  3. Eduardo Gomez 2011-06-24

    Associated HD Support ticket: http://support.appcelerator.com/display/APP-689527
  4. Don Thorp 2011-06-30

    testing, merging, etc.
  5. Natalie Huynh 2011-07-06

    Tested with Nexus S 2.3.4 and Nexus One 2.2.2 with 1.7.2.v20110630161836
  6. Don Thorp 2011-11-05

    Standardizing summary and labels.

JSON Source