Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

增加PermissionGot注解 #12

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

Open
holybible wants to merge 1 commit into hongyangAndroid:master
base: master
Choose a base branch
Loading
from holybible:master
Open

增加PermissionGot注解 #12

holybible wants to merge 1 commit into hongyangAndroid:master from holybible:master

Conversation

@holybible
Copy link

@holybible holybible commented Aug 5, 2016

在使用MPermission的过程中发现在权限已获得和弹出授权对话框并同意这两种情形所面临的代码执行环境是不同的,系统弹出的授权对话框会使得原activity回调到OnSaveInstanceState,而已授权的话则不会有弹框出现。在弹出授权对话框后,若执行的注解方法中包含Fragment#commit(DialogFragment#show)则会因IllegalStateException而Crash掉;而在已获得授权时则执行相应方法不会有问题,这说明应提供一种方式来应对两种不同的执行环境。

在修改中参照原有代码增加了PermissionGot注解,当提供PermissionGot注解方法时,已获得授权将执行此方法,当未提供PermissionGot注解方法时,已获得授权将执行PermissionGrant注解方法,即用户可根据自己所面临的实际情况来选择是否需要将两者区别对待,若需要则添加上PermissionGot注解方法即可

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /