[TIMOB-4079] Android: setInterval won't fire in app.js with TabGroup
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-11-05T13:48:36.000+0000 |
Affected Version/s | Release 1.7.0 |
Fix Version/s | Sprint 2011-26, Release 1.7.2, Release 1.8.0 |
Components | Android |
Labels | n/a |
Reporter | Jon Alter |
Assignee | Bill Dawson |
Created | 2011-05-13T12:21:33.000+0000 |
Updated | 2011-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();
Associated Helpdesk Ticket
http://appc.me/c/APP-938779Inspection 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.
Associated HD Support ticket: http://support.appcelerator.com/display/APP-689527
testing, merging, etc.
Tested with Nexus S 2.3.4 and Nexus One 2.2.2 with 1.7.2.v20110630161836
Standardizing summary and labels.