1
votes

Ive been trying to add a button to properly exit an Android app, built using Flex 4.6. I have used the command NativeApplication.nativeApplication.exit(); which seems to work on the emulator, and kills off the emulator.

When I run it on a device, it doesnt exit, it actually seems to go to start of the app (my login screen) which is kinda strange.

I hypothesise that something system-wide is holding the app in process or re-starting it. Anyone had any experience with this?

1

1 Answers

0
votes

That code should work. I use it in my android flex app with no problem. The application quits correctly and I am dropped back at the home screen. What version of Android are you using? I was using 2.3 when I did this. If you have it running in debug mode, do you see any errors output to the console? Using the debugger will also allow you to see if it is not quitting properly or restarting on quit(you would see the splash screen again if this was the case)