Android 设置请求定向后自动旋转不工作
我有一个允许自动旋转的活动:Android 设置请求定向后自动旋转不工作,android,autorotate,Android,Autorotate,我有一个允许自动旋转的活动: <activity android:name="com.xxx.ui.browse.exercise.ExerciseActivity" android:configChanges="orientation|screenSize|keyboardHidden|smallestScreenSize|screenLayout" android:exported="false"
<activity
android:name="com.xxx.ui.browse.exercise.ExerciseActivity"
android:configChanges="orientation|screenSize|keyboardHidden|smallestScreenSize|screenLayout"
android:exported="false"
android:theme="@style/Theme.XXX.Light" />
它也很有效。但是现在自动旋转不起作用了
我尝试在setRequestedOrientation之后调用,但没有效果:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
你们能帮帮我吗?很有趣,我在应用程序中使用了多年的相同功能/系统。我在定义的
android:configChanges=“orientation”
参数中看到的唯一区别,我不将其用于活动。试着移除它只是为了测试,如果这样有帮助的话。@Menionasam它不能正常工作
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);