标签:
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
boolean autoRotateOn = (android.provider.Settings.System.getInt(getContentResolver(),Settings.System.ACCELEROMETER_ROTATION, 0) == 1) ;
if(autoRotateOn){
Log.i("onResume", "可以自动旋转");
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
}else{
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER);
Log.i("onResume", "不可以自动旋转 用户首选");
}
}
标签:
原文地址:http://www.cnblogs.com/lucktian/p/5519654.html