I am opening a new Window when a button is pressed in the current displayed window. When the user clicks back or the back button in android I close my current window and it works fine. But when the user presses the home button of the application to go to the first window, all the other added window will keep there in background, and in android if the user presses the back button of the phone the app goes to the last opened window and not where it should go.
this is how I open a new window:
view.addEventListener('click', function(e) {
var win = Ti.UI.createWindow({
url : 'List.js'
});
win.open();
});
To close the window I use:
Ti.UI.currentWindow.close();
For example I have opened window A,B,C,D and in the D window I press the home button of the app where I must go to the B window. So I need to close the C and D window but I don't now how to close the C window that is in background.
I'm not using Alloy