Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4061] Android: setInterval does not run on first app launch

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2011-05-13T09:27:24.000+0000
Affected Version/sRelease 1.6.2
Fix Version/sn/a
ComponentsAndroid
Labels1.6.2, android, rplist
ReporterJon Alter
AssigneeDon Thorp
Created2011-05-12T17:49:05.000+0000
Updated2011-05-13T09:27:24.000+0000

Description

If the function passed into setInterval will not run the first time you run the app. If you exit the app and relaunch, the function will begin to execute. Step 1: run the code below Step 2: notice the lack of output in the log Step 3: close the app Step 4: relaunch the app Step 5: see the output in the log
var win = Ti.UI.createWindow({
	backgroundColor:'blue',
	fullscreen: true
});

win.open();

var myfun = function() {
    Ti.API.info('timer fired!');
};

win.addEventListener('open', function(e){
	setInterval(myfun, 2000);
});

Comments

  1. Jon Alter 2011-05-13

JSON Source