Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Ending application

Discussion in 'Android' started by Mirek Uhlir, Mar 14, 2011.

  1. Mirek Uhlir

    Mirek Uhlir

    Joined:
    Dec 25, 2009
    Posts:
    124
    How works quit on Android? It is just like on iOS, the game still runs in the background, if iOS need then releases it from memory?
     
  2. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    Yes. Pressing the HOME button will pause the game, and the application may continue to live until you return to it, or it is killed by the OS.
    Calling Application.Quit will however release the application completely.
     
  3. jonbonazza

    jonbonazza

    Joined:
    Nov 6, 2010
    Posts:
    453
    Or pressing the back button when there is only one activity on the stack (Doing so with more than one activity on the stack will proceed to kill off each activity, one by one).
     
  4. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    No that is incorrect. While that is valid description of how the Android OS handles activities in general this is not true for the UnityPlayer activity. Because of how input is handled in Unity scripts (i.e. non-callback structure) you need to explicitly take care of the BACK input signal if you wish to quit your application. We also recommend that you "emulate" the stacking idea of the Android OS, where the BACK button would be used to cancel an in-game session back to the main menu / frontend.
     
unityunity