首页 > 代码库 > unity3D 锁屏再开程序崩溃

unity3D 锁屏再开程序崩溃

在Uniyt3d 调用Android Plugin 的时候,会出现锁屏后再开,程序就崩溃的的现象,解决办法就是在 AndroidManifest.xml 加入  android:configChanges 属性,例如:

<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" 
                  android:label="@string/app_name" 
                  android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"


            <meta-data android:name="android.app.lib_name" android:value="http://www.mamicode.com/unity" /> 
            <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="http://www.mamicode.com/false" /> 
        </activity> 

unity3D 锁屏再开程序崩溃