我有点难过。
我使用intent-filter
<intent-filter>
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>
示例:
<activity
android:name="xx.Rights"
android:label="@string/title_activity_rights"
android:parentActivityName="xx.MainActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="xx.MainActivity" />
</activity>
我已经用
添加了库支持 <uses-library android:required="false" android:name="com.sec.android.app.multiwindow" />
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
分屏效果很好。我可以创建一个半手机分屏以及我的Galaxy S7上的弹出视图。但经过长时间使用,多次弹出或分屏 - 我分屏或弹出的能力突然停止。
无论我在做什么活动,我都会收到(ActivityName) does not support split screen view
的祝酒词。所有活动都经过测试并在某些时候起作用。不确定触发此停止的原因。
这是我的Logcats在成功和失败使用期间。
分割屏幕
12-21 10:58:34.706 11166-11166/xx D/ViewRootImpl: #3 mView = null
12-21 10:58:36.546 11166-11166/xx D/ViewRootImpl: MSG_RESIZED: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
12-21 10:58:36.546 11166-11166/xx D/ViewRootImpl: MSG_RESIZED: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
返回全屏
12-21 11:00:51.056 18608-18608/xx D/ViewRootImpl: ViewPostImeInputStage processPointer 0
12-21 11:00:51.196 18608-18608/xx D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
12-21 11:00:51.856 18608-18608/xx D/ViewRootImpl: ViewPostImeInputStage processPointer 1
激活新活动,突然无法在任何地方使用分屏。
12-21 11:01:57.316 18608-18608/xx I/Timeline: Timeline: Activity_launch_request id:xx time:310566034
12-21 11:01:57.356 18608-18608/xx W/ResourcesManager: getTopLevelResources: /data/app/xx-1/base.apk / 1.0 running in xx rsrc of package xx
12-21 11:01:57.356 18608-18608/xx D/RelationGraph: garbageCollect()
12-21 11:01:57.356 18608-18608/xx W/ResourcesManager: getTopLevelResources: /data/app/xx-1/base.apk / 1.0 running in xx rsrc of package xx
12-21 11:01:57.386 18608-18608/xx D/Activity: performCreate Call Injection manager
12-21 11:01:57.386 18608-18608/xx I/InjectionManager: dispatchOnViewCreated > Target : xx.Rights isFragment :false
12-21 11:01:57.386 18608-18608/xx D/SecWifiDisplayUtil: Metadata value : SecSettings2
12-21 11:01:57.386 18608-18608/xx D/ViewRootImpl: #1 mView = com.android.internal.policy.MultiPhoneWindow$MultiPhoneDecorView{a0e161c I.E...... R.....ID 0,0-0,0}
12-21 11:01:57.436 18608-18608/xx I/InjectionManager: dispatchCreateOptionsMenu :xx.Rights
12-21 11:01:57.436 18608-18608/xx I/InjectionManager: dispatchPrepareOptionsMenu :xx.Rights
12-21 11:01:57.436 18608-18608/xx W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
12-21 11:01:57.446 18608-18608/xx D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
12-21 11:01:57.476 18608-18608/xx I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@ca335b6 time:310566192
12-21 11:01:57.736 18608-18608/xx V/ActivityThread: updateVisibility : ActivityRecord{6e259ab token=android.os.BinderProxy@ce5aea5 {xx/xx.MainActivity}} show : false
12-21 11:01:59.486 18608-18608/xx D/ViewRootImpl: ViewPostImeInputStage processPointer 0
12-21 11:02:01.226 18608-18608/xx D/ViewRootImpl: ViewPostImeInputStage processPointer 1
任何想法都表示赞赏。
感谢。