control orientation by sensor on Samsung devices

冷暖自知 提交于 2020-01-05 04:41:07

问题


I painfully found out today that

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);

Does not work properly on the latest Samsung devices.

I want to be able to set screen orientation by the state of the sensor, meaning that even if the device has portrait only set (on device level), if the user rotates the device to landscape my app should change configuration - Reload activity with the proper layout.

SCREEN_ORIENTATION_FULL_SENSOR works fine on any other device, and on old Samsung devices. New Samsung devices do all sort of crazy layout behaviour with that setting.

来源:https://stackoverflow.com/questions/44232033/control-orientation-by-sensor-on-samsung-devices

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