- Home /
Android: Application.Quit doesn't fully quit game?
Hey guys,
Well, I'm currently working on an Android game, but I can't seem to find a proper way to fully shut down a game by means of an on-screen button... Like, an Exit Button.
When I attached an Application.Quit() to it, it looks like it quit from the game, but when I check the background running apps, its still going on... When I tap on that background app, it opens up a "new" instance of the entire game.
Can someone tell me what to do?
Thanks!
Answer by GerryM · Feb 26, 2013 at 04:42 PM
Don't worry, it's working as expected.
The fact that your game does restart when you click it means that it actually did quit. Android doesn't necessarily delete the app from memory as this causes a higher load on the device than leaving it disabled. It eventually will purge it from memory.
The advantage is that it will restart your app even faster that way.
See here
Yes, the "background apps" are actually called "recent apps" ;) If you quit the game with Application.Quit it's really closed. When you tab it again it will completely restart. The feature of recent apps is an OS feature. You can't remove your app from this list.
Just check the real list of running applications. Go into settings/Apps/running and you see a list of currently running apps and services. You will never see your Untiy app there because it's suspended when you press the home button. tab the button on the top right "show cached processes". If you didn't quit your application you will see a cached process there which will be reloaded when you switch back to your app.
If you quit your app, it won't be listed there. The recent apps is really just a list of recently used apps which includes the ones that are currently running. You can't distinguish between them in the "recent apps view", so i usually keep the list short / empty as a user ;)
Cached processes are usually removed when the OS runs out of memory, but they have a hit on performance either way. So cleaning up the memory is one of the main tasks of the user on an Android tablet :D
edit btw your settings menu might look differently. I have a nexus7 tablet, just in case you can't find the menu items i've mentioned.
Oooooooohh... I see... Sorry, tad bit new to this Android development thang.
Thanks again guys! $$anonymous$$uch appreciated!
Your answer
