Quit program on Android
Posted: Mon Nov 18, 2024 5:33 am
Hi. Using your Menu Framework which is great but have a problem quitting the application on Android. Application quit doesn't work on Android. Unity suggests using something like
But I don't know how to work that into the SaveHelper.cs Halt Program function.
It handles quitting the application on the Unity Standalone and Editor choices but somehow have to add Android. Would it be if UNITY_ANDROID ??
And would it be ok to put the above code Unity suggests after that?
Thanks for any help.
Code: Select all
{
AndroidJavaObject activity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");
activity.Call<bool>("moveTaskToBack", true);
}
It handles quitting the application on the Unity Standalone and Editor choices but somehow have to add Android. Would it be if UNITY_ANDROID ??
And would it be ok to put the above code Unity suggests after that?
Thanks for any help.