Support split screen in Android N+ only on tablets

2020-07-14 06:17发布

Is there a way to configure multi-window support for an activity only on screens large enough, e.g. tablet?

https://developer.android.com/preview/features/multi-window.html#configuring doesn't mention that. Setting android:minimalHeight and android:minimalWidth seems to not help, because

If the user moves the divider in split-screen mode to make an activity smaller than the specified minimum, the system crops the activity to the size the user requests.

Use case: for certain activities, it might not make sense to be run in very small (split) screen sizes. In those situations, the activity should not support multi-window mode.

1条回答
一纸荒年 Trace。
2楼-- · 2020-07-14 06:29

You could create multiple APKs (one for phone, one for tablet) using the tag

<supports-screens>

in your manifest, and then enable split screen support only on the tablet APK.

查看更多
登录 后发表回答