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

xiaoxiao2021-02-27  258

//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"/>权限
转载请注明原文地址: https://www.6miu.com/read-8787.html

最新回复(0)