Pressing Android back button goes to splash screen instead of closing app

You must Login before you can answer or comment on any questions.

From within my app the physical android back button works mostly as expected, but pressing it a few times eventually takes the user back to the splash screen instead of closing the app. That is, the splash screen acts as if it was a window within my app.

Any ideas on how to get rid of this and have the app close instead of display the splash screen?

1 Answer

Accepted Answer

When you are creating your main window (the one that needs to close the app when the back button is pressed), make sure you set the exitOnClose property to true - like this for example:

var mainWindow = Titanium.UI.createWindow({
    title:"Main window",
    exitOnClose:true
});

— answered 1 year ago by Goran Skledar
answer permalink
4 Comments
  • Thanks very much!

    — commented 1 year ago by Parand Darugar

  • What if your app requires multiple end points? Such as exiting from normal windows prior to logging in, but also from a tabbed application after loggin in?

    — commented 2 months ago by Brad White

  • Exactly Brad!

    I have a login window, once you've logged in correctly it closes the login window and opens the one with the app content etc. So, if I use this property it will close the app when people logged in correctly :S. What should I do here? Thanks.

    — commented 2 weeks ago by Reine Cárdenas

  • Show 1 more comment

Your Answer

Think you can help? Login to answer this question!