[TIMOB-4061] Android: setInterval does not run on first app launch
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2011-05-13T09:27:24.000+0000 |
Affected Version/s | Release 1.6.2 |
Fix Version/s | n/a |
Components | Android |
Labels | 1.6.2, android, rplist |
Reporter | Jon Alter |
Assignee | Don Thorp |
Created | 2011-05-12T17:49:05.000+0000 |
Updated | 2011-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
- Jon Alter 2011-05-13