Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

How to quit Unity Android app using Process.KillProcess

Discussion in 'Android' started by BeringelaUnity, Sep 21, 2016.

  1. BeringelaUnity

    BeringelaUnity

    Joined:
    Jun 9, 2016
    Posts:
    5
    I want to quit a Unity Android app in such a way that the process is killed completely, and not paused or suspended or anything similar.

    To meet this requirement for a non-Unity program, developed in Xamarin/C#, I successfully called this code in C# and all was well:

    Android.OS.Process.KillProcess(Android.OS.Process.MyPid());

    How can I achieve this from Unity? I know Application.Quit() does seem to quit the game, but I can't tell if the process is being killed completely. To be safe I'd like to call the code above from Unity, but don't know how.
     
  2. OmerNazir

    OmerNazir

    Joined:
    Dec 3, 2020
    Posts:
    2
    Last edited: Dec 15, 2020