landscape mode in tablet only

会有一股神秘感。 提交于 2019-12-07 01:32:43

问题


My app has to support landscape/portrait mode only for tablets, phones will only support portrait mode. What is the best way to implement this?

Options that I am considering:

a) using two apk files, one for phones and one for tablets. The one for phone will lock landscape mode in the manifest

2) using one apk file. Detect that device is a phone, lock landscape mode inside each activity.

any advice will be appreciated.

Regards


回答1:


You can use a SuperClass for activities and implement this https://stackoverflow.com/a/9629127/710162 on, for example, onCreate().



来源:https://stackoverflow.com/questions/5788448/landscape-mode-in-tablet-only

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