exitOnClose is a property of User Interface Window Class. This property will force close the window when the user tap over "back" button of Android Device and this window is opened.
Also, you can quit app with this code:
Ti.Android.currentActivity.finish();
For example (myWindow = UI.Window.createWindow ...):
var quitFunction = function quitFunction() {
var dialog = Ti.UI.createAlertDialog({
cancel : 1,
buttonNames : ['Accept', 'Cancel'],
message : 'Do you want exit?',
title : 'Quit App'
});
dialog.addEventListener('click', function(e) {
if (e.index === 0) {
Ti.Android.currentActivity.finish();
}
dialog.hide();
dialog = null;
});
dialog.show();
};
myWindow.addEventListener('android:back', quitFunction);
quitFunction can be changed with other purpose and you can control programatically its call.
iOS have not this phisical button, so we can not use this property for this.