Quantcast
Channel: Answers for "Application.quit() not working on android"
Viewing all articles
Browse latest Browse all 9

Answer by meat5000

$
0
0
You can script it for the back button but iOS and Android have a User Discretion policy on app quit these days. Basically back button will normally lose focus and pause but the app moves to background. You can set it to quit but you should show a dialogue to confirm quit for good Android practise, I believe. I read that back button is the same as Escape key but I'm yet to try it. if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } Edit: Just tried the following on a GUITexture in my touch routine. if(menuButtons.HitTest(GUIRay).name == "QuitMenuButton" && theTouch.phase == TouchPhase.Began) { Application.Quit(); } It Quit the App. However Android 4.3 showed strange behaviour. The program remained inside my open apps list. If I went back to the game in the list it reloaded the game from start. So although the game quits it seems to not Unload fully.

Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>