我正在开发一个Android应用,想知道用户是否启用了自动旋转功能。请问有谁知道如何获取这个信息?为了明确起见:我只需要知道用户是否在设置中启用了自动旋转。
Settings.System.ACCELEROMETER_ROTATION
获取自动旋转信息的开/关状态。if (android.provider.Settings.System.getInt(getContentResolver(),Settings.System.ACCELEROMETER_ROTATION, 0) == 1){
Toast.makeText(Rotation.this, "Rotation ON", Toast.LENGTH_SHORT).show();
}
else{
Toast.makeText(Rotation.this, "Rotation OFF", Toast.LENGTH_SHORT).show();
}