android 开启自动旋转屏幕的实现代码

来源:互联网 发布:sql简单查询语句 编辑:程序博客网 时间:2024/06/06 04:44
//0为关闭 1为开启
Settings.System.putInt(getContentResolver(),Settings.System.ACCELEROMETER_ROTATION, 1);//得到是否开启int flag = Settings.System.getInt(getContentResolver(),Settings.System.ACCELEROMETER_ROTATION, 0);需要添加<uses-permission android:name="android.permission.WRITE_SETTINGS"/>权限
原创粉丝点击