Back button not fire the second and third window in tab
Hi all,
The real problem of my App is that I want to return to the previous window when I press the Back button, but the BAck button does not perform well.
There are 2 tabs: fristTab and secondTab in the tabGroup. In the secondTab, there are 3 window: firstWindow, secondWindow, and thirdWindow. I have add event to back button in all windows. As a result, only the firstWindow that the back button works. However, the Back Button on secondWindow and thirdWindow do not perform as what I expect. When I press the Back Button, it does not do anything as if I don press the Button.
Here is the code in firstWindow, but other 2 are the same.
firstWindow.addEventListener('android:back', function() {
var dlg = Ti.UI.createAlertDialog({ message : 'Exit?',
buttonNames : ['OK','Cancel']});
dlg.addEventListener("click", function(e) {
if (e.index == 0) {
dlg.hide();
firstWindow.close();
}
});
dlg.show();
});