Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9712] Android: Window open event is not consistent

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-04-24T13:16:08.000+0000
Affected Version/sRelease 2.0.2, Release 2.0.1, Release 3.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsapi, exalture, parity
ReporterNikhil Sharma
AssigneeSunila
Created2012-06-21T15:56:52.000+0000
Updated2017-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();

Comments

  1. Shameer Jan 2013-02-26

    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.
  2. Sunila 2013-04-24

    Tried with SDK 3.2.0 in Nexus S. The event is fired consistently.
  3. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced.

JSON Source