- Home /
Quit Application on Android
Hi.
I would like to know if there is a way to call the standard Quit function on Android. I know that I can quit an application use the Application.Quit and the Escape button. But this just close the application, without confirm if that is what the user really wants. So, I would like to display a message like this:
This style is completely different from the game style, so, it seems to me that it was call a Android function, I don't know...
Well, anyway, this is what I would like to do. This is possible?
Thanks.
I'm not sure but it seems you have to make a plugin which will call the Alertdialog of Android : http://developer.android.com/reference/android/app/AlertDialog.Builder.html
Why not just present the user with some unity GUI, if they touch/press/click exit, then execute the application quit, otherwise, close/hide the unity GUI.
This is what I have done. I am just wondering if there is a easy way to show this Yes/No that most game show (with Android style), without making more Unity GUI.
Answer by Paulius-Liekis · Dec 05, 2012 at 01:26 PM
IIRC, Prime31 plugins give you functionality to show these basic dialogs.
Answer by Landern · Dec 05, 2012 at 01:56 PM
You can create your own plugin for android, but you will have to dig out the correct code to end the Unity Activity on the device. Here is the documentation, will take a little more work, but i'm sure you can manage.
Your answer
