Project: titanium
Issue TIMOB-17818: Android: window.exitOnClose closes app on close(), not just back button
The doc states: "Boolean value indicating if the application should exit when the Android Back button is pressed while the window is being shown." However, exitOnClose closes the app even when the window is closed programatically. The app should be closed only when back is pressed on the window, as written in the doc. There is little sense in closing an app programmatically. Here is a problematic (but fairly typical) scenario: 1. First time user entry opens login window 2. After login app opens win1 3. Normally, pressing "back" on win 1 should close the app (win1.exitOnClose = true) 4. If logged in at entry, the login page is not opened, and the app opens win1. Again, win1.exitOnClose = true usually does the job 5. However, if the user elects to "logout" from the app (e.g. logout menu item on win1), then win1 should close (win1.close() called) and the login window should open. But if win1 closes and exitOnClose == true, then the logout closes the app completely. Thus, exitOnClose should function for the back button only. Alternatively, exitOnClose can be a dynamic property: win1 in this case will normally have exitOnClose == true, but in case of a logout event win1.exitOnClose should be set to false.
Story points: 5