Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

授权时屏幕旋转会出现多个权限弹窗 #49

Closed
haianhsing opened this issue Oct 29, 2020 · 4 comments
Closed

授权时屏幕旋转会出现多个权限弹窗 #49

haianhsing opened this issue Oct 29, 2020 · 4 comments

Comments

@haianhsing
Copy link

屏幕旋转时,fragment会出现销毁重建的情况,然后会出现多个权限弹窗

@getActivity
Copy link
Owner

getActivity commented Oct 29, 2020

通过原生 API context.requestPermissions 调起授权对话框,但是这个对话框是系统弹出来的,而不是应用弹出来的,所以框架并不能控制让它显示或者隐藏。

@getActivity
Copy link
Owner

要解决这个问题也很简单,你需要在清单文件中加入

android:configChanges="orientation|screenSize|keyboardHidden"

这样就能让 Activity 在进行屏幕旋转的时候不进行重启

@getActivity
Copy link
Owner

又或者在清单文件中锁定 Activity 的方向

@getActivity
Copy link
Owner

小伙子,框架最新版本已经处理了这个问题,解决方式是申请权限时将 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

No branches or pull requests

2 participants