- Home /
How do i stop mUnityPlayer.quit() closing the entire android app?
I'm working on an app that combines eclipse and unity. The use can switch activity to an activity that contains an instance of a UnityPlayer, displaying inside a view.
When i switch from this activity to another activity, mUnityPlayer.quit() is called to free the resources and end the player.
For some reason, this is closing the entire Application and not just the activity. How can i stop this behaviour?
Answer by jfmichel · Dec 10, 2013 at 10:13 PM
You can stop this behavior by specifying a different process name (f.i. ":unity") for the UnityPlayerActivity in the Android Manifest. It seems UnityPlayer kills its process when quit() is called so you just have to be sure your Application and other Activities have a different process name (by default it's the Application package name).
See http://developer.android.com/guide/topics/manifest/activity-element.html#proc for more info.
hi, what if I use unity3d just in a subview of a normal android activity, when I close the unityplayer, I don't wanna exit the current activity, I have already set the android:process, but it's useless, can you give me some suggestions, thanks a lot!
Your answer
Follow this Question
Related Questions
Proper way for Quit Application 2 Answers
Application.quit() not working on android 5 Answers
How do I Force Application to Quit if no internet connection available 1 Answer
Embedding unity into existing android app: UnityPlayer.quit kills app process 0 Answers
Android and Unity - creating a transparent Activity 1 Answer