Exiting application ?

I am expecting to have an Exit button in my app, not just force the user to keep pressing the back button until they get out of the app.

so if the requestExit was working that would be just fine with me. The requestExit did not work in the simulator, but I can test it on the device for verification.

Larry

I’m not sure if Microsoft allows GUI exit buttons at all. According to their design guides devs should rely on hardware buttons for back and exit functions. If you want to exit the app instantly you just press the middle home (start) button.

Jetpak Joyride has Exit button. and a prompt when it is clicked… Are you sure you want to exit.

So I don’t this it should be a problem. Also forcing a user to keep touching the back button is just a bad design. they should have an easy way to exit.

Larry

There’s a back button but there’s also a start (middle) button. The one with windows logo. When you hit it - you exit app instantly. Like a home button on iOS.

yep I know, my cell is a win 8.1 phone.

These buttons should work exactly like android

Back button should go back screen by screen - just like android.

The home button should suspend just like android - the OS cleans up suspend apps as needed.

Side note on Win 8 phone
If you hold the Back Button down for several seconds all running apps will display in which you can switch between them and your app will / should suspend, or you can kill the app by clicking on the presented (x) in the righ hand corner.

Larry

Microsoft has design guidelines for how to handle backing out or exiting the app here…

   http://msdn.microsoft.com/en-us/library/windows/apps/dn148258(v=vs.105).aspx

While they would typically prefer that you back out of an app naturally, there is a blurb in their guidelines that it’s okay to just back out to the root page if the end-user is several pages deep within an app.  Games and other media style apps typically get a pass on how to handle navigation, such as showing an “Are you sure?” before backing out of the app in case you accidentally tap the back button.  I think the bottom line is that the navigation of your app just has to make sense.  Although, I think they generally prefer that you take advantage of the Back button for navigation instead of an onscreen button.

Everyone,

I’ve looked into this issue.  The native.requestExit() function will actually work if your app has pages to navigate back to, but it won’t do anything if your app has no more pages in its history.  That is, it won’t exit the app.  After refreshing my brain as to why, it’s because WP8’s native APIs does provide a nice means of exiting an app like Android.  The only native WP8 API available to exit the app is to forcefully quit the app, much like how os.exit() works now.

But that said, I’ve implemented a bit of a hack-ish solution that is the closest equivalent to exiting the app like Android.  Calling native.requestExit() will be non-blocking like Android, all of your app’s XAML controls will be “Unloaded”, you’ll receive an “applicationExit” event in Lua, and then the app will be forcefully terminated.  Unfortunately, you’ll never receive a “Closing” event in your “App.xaml.cs” because it’s been forcefully exited (if you’re even using it).  This forceful quit will be a bit noticeable because your app won’t do the slide-out animation when exiting out, which is what you normally see when pressing the back key.  Instead, it simply blacks-out and the previous screen appears.  Because of this, I highly recommend that you let your app be gracefully closed via the Back key event by *not* returning true in your Lua key event listener if you can.

(Welcome to the challenges of cross-platform development.)

A new build of CoronaCards for WP8 should be made available to you all later today.

Thanks for bringing up this issue.