解决方法
您可以使用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(); }