RxPermissions icon indicating copy to clipboard operation
RxPermissions copied to clipboard

isGranted is always true

Open yuxinLi opened this issue 7 years ago • 6 comments

the code is like below:

`new RxPermissions(getActivity()) .request(CAMERA, RECORD_AUDIO) .subscribe(new Action1<Boolean>() { @Override public void call(Boolean isGranted) { if (isGranted) {

                    } else {
                    }
                }
            });`

firstly , the "isGranted" is true , and then the phone show the permission dialog , I click refuse , but next time , the "isGranted" is also true

yuxinLi avatar May 31 '17 03:05 yuxinLi

the android os version is : 6.0.1

yuxinLi avatar May 31 '17 03:05 yuxinLi

firstly , the "isGranted" is true , and then the phone show the permission dialog

No. The Action1 is only invoked when user has answered all permission dialog requests.

tbruyelle avatar May 31 '17 22:05 tbruyelle

I have encountered the same problem, may I ask this question solved?

ChinaDragon01 avatar Jun 23 '17 09:06 ChinaDragon01

@yuxinLi @ChinaDragon01 do you have some example project for reproducing it?

epool avatar Jun 23 '17 21:06 epool

I had encountered the same problem.Then I changed the targetSdkVersion to be great than or equal to 23, It solved.

nsdnext avatar Jul 14 '17 09:07 nsdnext

// when targetSdkVersion < Build.VERSION_CODES.M(23), calling like below: // ContextWrapper.checkSelfPermission or Context.checkSelfPermission , // it will always return PERMISSION_GRANTED i will give a pr of that

gao746700783 avatar Oct 22 '18 10:10 gao746700783