[TIMOB-3083] Android: setTimeout won't fire in heavyweight window's own JS context (i.e., new activity+ url) the first time
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-05-10T20:17:25.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.7.0, Sprint 2011-18 |
Components | Android |
Labels | android, defect, release-1.6.1, release-1.7.0, reported-1.5.1, rplist |
Reporter | Bill Dawson |
Assignee | Marshall Culpepper |
Created | 2011-04-15T03:36:29.000+0000 |
Updated | 2011-05-13T10:17:33.000+0000 |
Description
Titanium 1.6.0 2fab4fc209, Android 2.2 (with Google APIs) emulator. The problem below also does not work in 1.5.1, so I guess it's not really a regression. Didn't try anything older than that.
If you put a setTimeout
in a heavyweight window
with its own js context (i.e., with a url), it won't fire the very
first time you go to the window. If you back out and go back in
again, it will.
app.js:
Titanium.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({
title:'Test',
backgroundColor:'#000',
exitOnClose: true,
url: 'win.js',
fullscreen:false // makes it heavyweight
});
win.open();
win.js:
setTimeout(function(){Ti.API.info('Timeout firing');},3000);
Do the following:
-
build and launch.
-
watch logcat -- "Timeout firing" will not appear.
-
back out
-
relaunch & watch logcat. You'll see the firing message.
Maybe this only happens when the heavyweight window is the first window showing in the app. Haven't tested.
There is a http://developer.appcelerator.com/helpdesk/view/76531">helpdesk ticket that has also encounter this problem. The code provided is very similar to the one above. I changed the "fullscreen" property from false to true, and it makes no difference. On Ti. SDK 1.5.1 it works as expected.
Tested with Ti. SDK 1.6.1
Android Emulator APIs 2.2 Screen HVGA
Note ticket #3184 which may be related.