The problem
Heavyweight window can't be closed using hardware back-button when it has "android:back" event listener attached.
Test case
To see this problem run this example:
var win = Ti.UI.createWindow({
backgroundColor: '#000'
});
var button = Ti.UI.createButton({
title: 'Open window'
});
button.addEventListener('click', function() {
var win1 = Ti.UI.createWindow({
title: 'Click back button',
modal: true,
backgroundColor: '#369'
});
win1.addEventListener('android:back', function() {
Ti.API.info('Android:back');
});
win1.open();
});
win.add(button);
win.open();
Click on button and then try to close a window using hardware back-button. You should see that window did not close, while event has been fired as it can be seen in console output.
Expected behavior
Window needs to be closed when hardware back-button is clicked. Note that this works fine when example is compiled with 1.8.1 SDK.
Just to add ... it seems that tabgroup also can't be closed using hardware back-button when some window in it has "android:back" event attached.
This seems to be fixed in latest CI, so it can be closed.
Not able to reproduce. Please note that in the example above, the only result that should be noticed clicking on the back button is to display the 'Android:back' in the console log. To also close the window, 'win1.close()' should also be added in the eventListener.