Support split screen in Android N+ only on tablets

时间秒杀一切 提交于 2019-12-21 16:17:43

问题


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:


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.



来源:https://stackoverflow.com/questions/37402060/support-split-screen-in-android-n-only-on-tablets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!