android:screenOrientation="user"

参考:https://stackoverflow.com/questions/12567368/my-android-app-rotates-even-if-screen-rotation-is-disabled-in-the-os-how-can-i

I am developing an Android app that has full support for landscape mode. All of my activities have the following properties set in the manifest:

android:configChanges="keyboardHidden|locale|orientation"
android:screenOrientation="sensor"

However, if I disable rotation in the phone's Screen settings, my app still rotates when the phone is rotated. This kind of bothers me; it seems like the whole point of a system-level setting is moot if it can be overriden by an individual app. How can I fix this so it follows the system-level setting while still behaving properly if screen rotation is enabled on the phone?

posted @ 2018-06-07 15:07  君子求诸己  阅读(955)  评论(0)    收藏  举报