Skip to content

fix #4 Only fullscreen opaque activities can request orientation - #6

Closed
guok2046 wants to merge 1 commit into
Tencent:devfrom
guok2046:fix_fullscreen_crash
Closed

fix #4 Only fullscreen opaque activities can request orientation#6
guok2046 wants to merge 1 commit into
Tencent:devfrom
guok2046:fix_fullscreen_crash

Conversation

@guok2046

Copy link
Copy Markdown
Contributor

close #4

@shifujun
shifujun self-requested a review June 20, 2019 05:18

@shifujun shifujun left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确定该问题是否为Android8.0的bug,并已经在9.0上修复后。如果是的话,单独提供一个Android8.0上使用屏幕旋转Activity的例子,或者只写在文档里即可。

/**
* 这里配置对应的对应关系
*/
case "com.tencent.shadow.sample.plugin.app.lib.usecases.activity.TestActivityOrientation":

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样可能会暗示需要屏幕旋转的Activity不能有透明色。

@guok2046

guok2046 commented Jun 20, 2019

Copy link
Copy Markdown
Contributor Author

问题的原因是8.0系统上Activity 在onCreate的时候会判断3个条件,如果3个条件都命中了,则抛出异常。这三个条件分别是
1.tagetSDKVersion 大于 O
2.先获取配置的orientation信息,判断是否配置了横竖屏
3.判断当前window的style属性,是否配置了transparent或floating或swipeToDismiss
image
image
image

@marsyu

marsyu commented Jun 26, 2019

Copy link
Copy Markdown

可以做如下设置 android:screenOrientation="behind",让当前的activity跟随前一个activity的方向

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only fullscreen opaque activities can request orientation

3 participants