为 Android 禁用 multi-window 模式

Disable multi-window mode for Android

我是unity新手。我试图为 android 设备开发 space 射击游戏,发现在 Api24+ 中 multi-window 破坏了设计。

所以我尝试通过将清单添加到名为 AndroidManifest.xml 的目录 "Assets/Plugins/Android/" 来制作自定义清单。

如上所示:

https://docs.unity3d.com/Manual/android-manifest.html

然后添加以下行 android:resizeableActivity="false" 以禁用分屏模式。

如上所示:

https://developer.android.com/guide/topics/ui/multi-window.html

但是什么都没发生我还能在游戏里使用multi-window模式

编辑:

我只将 android:resizeableActivity="false" 添加到应用程序,但失败了:

<application android:theme="@style/UnityThemeSelector" android:resizeableActivity="false" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false" android:isGame="true" android:banner="@drawable/app_banner">

将android:resizeableActivity="false"添加到activity也解决了我的问题:

<activity android:name="com.unity3d.player.UnityPlayerActivity" android:resizeableActivity="false" android:label="@string/app_name" android:screenOrientation="fullSensor" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density">