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

First request always emits granted=true before real request happens #3

Open
stari4ek opened this issue Jul 30, 2016 · 1 comment
Open

Comments

@stari4ek
Copy link

  • andtoid tv emulator, api 24
  • sample is used
  • press any "enable ..." button - toast with "true" is shown before request appeared
  • all next requests will work well

In this case permissionList is empty:

.map(permissionList -> {
    for (Permission p : permissionList) {
        if (!p.isGranted) {
            return false;
        }
    }
    return true;
});

rxpermissions_issue

@stari4ek
Copy link
Author

It happens cause Fragment.isAdded called in createPermissionRequest returns false when it's called within onAttach.
Technically there is no need in this check, cause createPermissionRequest is guarded by it's callers and always executed when fragment is attached.
Dropping this check fixes issue

stari4ek added a commit to stari4ek/RxPermissions that referenced this issue Jul 31, 2016
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

1 participant