Because of the need to use unity on Android (Android activity inherits unityplayeractivity from Unity), it could be a third-party reason to quit unity and cause the Android app to be recreated once, Many of the previously initialized variables have been reset. At the same time return after the life cycle method actually does not execute! Toss for a long time do not know why, and then think that since it is a third-party things, then I should be unityplayeractivity the list of properties to change, as follows:
<activity android:name="me.xanaduo.ui.UnityActivity" android:process=":UnityActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen" ></activity>
Note that the above android:process= ": Unityactivity" is the key point. For this attribute, we search for relevant explanations by ourselves. So the unityactivity run in their own processes, and they do not affect each other.
How Android uses unity to cause activity to be destroyed