[TIMOB-9712] Android: Window open event is not consistent
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2013-04-24T13:16:08.000+0000 |
Affected Version/s | Release 2.0.2, Release 2.0.1, Release 3.1.0 |
Fix Version/s | n/a |
Components | Android |
Labels | api, exalture, parity |
Reporter | Nikhil Sharma |
Assignee | Sunila |
Created | 2012-06-21T15:56:52.000+0000 |
Updated | 2017-03-21T21:33:56.000+0000 |
Description
Window open event doesn't fire consistently. It works fine on iOS. On android, sometimes do not get the "open1" alert.
Repo Steps
1. Run the below code in your app.js 2. You can see that the "open1" alert is not consistent.
var tabGroup = Ti.UI.createTabGroup();
var win = Ti.UI.createWindow({ backgroundColor: '#fff', title: 'Win 1' });
win.addEventListener('open', function() {
alert('[open1] size: ' + win.size.width + ', ' + win.size.height);
});
win.addEventListener('focus', function() {
alert('[focus1] size: ' + win.size.width + ', ' + win.size.height);
});
tabGroup.addTab(Ti.UI.createTab({ window: win, title: win.title }));
win.addEventListener('open', function() {
alert('[open2] size: ' + win.size.width + ', ' + win.size.height);
});
win.addEventListener('focus', function() {
alert('[focus2] size: ' + win.size.width + ', ' + win.size.height);
});
tabGroup.open();
The problem can reproduce with Latest release 3.0.2 and master release 3.1.0 . Tested on: Titanium Studio, build: 2.1.2.201208301612 Titanium SDK version: 3.1.0 (26/02/2013) Titanium SDK version: 3.0.2 (26/02/2013) Device: Samsung galaxy s duos Android version: 4.0.4 There exist an inconsistency with the window open event.For the first time it shows (0,0) as the "width" and "height" of window . After one or two attempts it shows original value .But there exist another inconsistency with the "open1" alert, it always shows zero for the "width" value,and most probably its a bug.
Tried with SDK 3.2.0 in Nexus S. The event is fired consistently.
Closing ticket as the issue cannot be reproduced.