[英]How to detect device orientation changed while activity is locked to portrait mode?
[英]Check if device is locked in Portrait mode
如果將設備設置啟用為鎖定屏幕方向,是否可以獲取信息?
您可以像這樣檢查Settings.System.ACCELEROMETER_ROTATION設置的值:
final int rotationState = android.provider.Settings.System.getInt(
getContentResolver(),
Settings.System.ACCELEROMETER_ROTATION, 0
);
啟用自動旋轉后,此值等於1(否則等於0)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.