1 . excludeFromRecents控制在不在recent列表中显示
true时不显示;false显示,默认
<activity
android:name=".MainActivity"
android:alwaysRetainTaskState="true"
android:excludeFromRecents="true"
android:exported="true"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density"
android:launchMode="singleInstance"
android:resizeableActivity="${resizeable}"
android:screenOrientation="landscape"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
2.多窗口属性resizeableActivity
application标签下可设置全局
activity标签下可设置单个activity
android:resizeableActivity="${resizeable}"
这个属性的设置会导致三种情况:
① 如果不声明这个属性,那么默认允许进入多窗口模式,但是会有上面图片的提示(第一次运行的时候)
② 如果声明了这个属性,并设置值为true,那么允许进入多窗口模式,并且不会提示
③ 如果声明了这个属性,并设置值为false,那么不允许进入多窗口模式,只允许全屏显示
窗口变化属性configChanges
android:configChanges=“keyboardHidden|orientation|screenSize|mcc|mnc|keyboard|navigation”
多窗口下对应用窗口大小缩放,会触发Configuration变化,可能的变化有screenSize、smallestScreenSize、layoutDirection、screenLayout、orientation,建议Activity的manifest配置configChanges,否则Activity将被销毁重建,可能导致卡顿和跟体验差。