Android game need quit button

mariosat

  • Posts: 18
im developing an android game and i want an quit button to stop the game.when i got out of the game wih my back key on my mobile the game still run in background pleas help

KreationsDesign

  • Posts: 102
I am wondering the same thing...

Neotron

  • Posts: 475
Really Stencyl does not provide any way to exit from Android app? Any idea?

Rares

  • Posts: 216
Who does use buttons provided by the game to exit the game anymore? I mean really, most games do not have quit buttons, you just use the ones from Android.
Last version (0.1.5) of my now cancelled game:
http://www.stencyl.com/game/play/27241


id8games

  • Posts: 205
If you go to Settings > Mobile > User Input, there is a switch to"Override Back Button".

See this article: http://community.stencyl.com/index.php/topic,21520.0/topicseen.html

My only problem with this solution is even though you can Override the back button, and setup for example the Escape key to go back to the "Menu" screen in your game - there should be an option that if you press the back button again, it quits the game.

Right now the option in the Mobile > Input, just overrides the back button.
Anyone know how to actually quit a game on Android?

GuyCockcroft

  • Posts: 193
I'm not sure if this is the official way, but I managed to do this by adding a code block that fires off this line of code when you hit the "quit" button:

nme.system.System.exit(1);

This doesn't actually shut down the app, but it does kick you out to Android.

Neotron

  • Posts: 475
Oh, interesting! And where you added this code?
Flow > Advanced section and Code:?


Tahaali54

  • Posts: 7
Thanks a bunch Buddy! =D

momotarot

  • Posts: 8
To really quit the android app.  Try this:

nme.Lib.exit();