Allow Multiple Run Time Permission


Answer :

First parameter is android.app.Activity type, You can't pass context at this place so use this instead of context like below code :-

if (ActivityCompat.shouldShowRequestPermissionRationale                         (this, READ_PHONE_STATE) ||ActivityCompat.shouldShowRequestPermissionRationale                         (this, WRITE_EXTERNAL_STORAGE)||                         ActivityCompat.shouldShowRequestPermissionRationale                                 (this, CAMERA) ||                         ActivityCompat.shouldShowRequestPermissionRationale                                 (this, READ_CONTACTS) || ActivityCompat.shouldShowRequestPermissionRationale                         (this, CALL_PHONE) || ActivityCompat.shouldShowRequestPermissionRationale                         (this, ACCESS_FINE_LOCATION) || ActivityCompat.shouldShowRequestPermissionRationale                         (this, READ_SMS)) 

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"