1,Caused by: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation
字面意思就是说:只有不透明的全屏activity可以自主设置界面方向。
网上搜了搜,发现不是个例,这个问题出现在android8.0以上。原因是我们给Activity同时设置了 android:screenOrientation=”” 和 true。
没办法,解决适配呗(-_-)。
解决办法:删除AndroidManifest中相应Activity的 android:screenOrientation=”“属性;或者删除相应Activity的theme中true属性。
二者只留其一,若两种效果都需要,只能另辟蹊径了。
经过网上搜索得知,这个属性一般不要使用。
参考:https://blog.youkuaiyun.com/qq_28484355/article/details/79125651