Issue description
Events open, focus event not woking on Ti.UI.Window for BB10. To replicate just keep clicking Open & Close buttons, back'n forth.
Check code example
Ti.API.info('Loading app.js');
var masterWindow = Ti.UI.createWindow({
title : 'Master Window',
barColor : '#000000',
backgroundColor : 'green'
});
masterWindow.addEventListener('focus', function() {
Ti.API.info('Master Window focused');
});
masterWindow.addEventListener('open', function() {
Ti.API.info('Master Window opened');
});
masterWindow.addEventListener('close', function() {
Ti.API.info('Master Window closed');
});
var detailWindow = Ti.UI.createWindow({
title : 'Detail Window',
backgroundColor : '#ffffff'
});
detailWindow.addEventListener('focus', function() {
Ti.API.info('Detail window focused');
});
detailWindow.addEventListener('open', function() {
Ti.API.info('Detail window opened');
});
detailWindow.addEventListener('close', function() {
Ti.API.info('Detail window closed');
});
var btnClose = Ti.UI.createButton({
title : 'Close'
});
btnClose.addEventListener('click', function() {
detailWindow.close();
});
detailWindow.add(btnClose);
var btnOpen = Ti.UI.createButton({
title : 'Open'
});
btnOpen.addEventListener('click', function() {
detailWindow.open();
});
masterWindow.add(btnOpen);
masterWindow.open();
Console output
From time to time iOS fires Window events consistently.
[INFO] : Loading app.js
[DEBUG] : Application booted in 112.212002 ms
[INFO] : Master Window opened
[INFO] : Master Window focused
[INFO] : Detail window opened
[INFO] : Detail window focused
[INFO] : Detail window closed
[INFO] : Master Window focused
[DEBUG] : Loading: /Users/egomez/Library/Application Support/iPhone Simulator/7.1/Applications/224D5BC6-B644-43FE-8678-89C63A0C3A30/BlackBerryTests.app/_app_props_.json, Resource: _app_props__json
[INFO] : Detail window opened
[INFO] : Detail window focused
[INFO] : Detail window closed
[INFO] : Master Window focused
BlackBerry isn't firing Window focus events and Master Window Open event is only fired once.
[INFO] Loading app.js
[INFO] Master Window opened
[INFO] Detail window opened
[INFO] Detail window closed
[INFO] Detail window opened
[INFO] Detail window closed
PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/218
Closing as resolved.