Can anyone explain why onRequestPermisionRequest
is created and what is the use of grant results which is passed as argument in Java for Android?
Asked
Active
Viewed 150 times
1
-
Chcek this answer->https://stackoverflow.com/questions/33666071/android-marshmallow-request-permission – Suhas Ts Aug 26 '18 at 05:21
-
Thanks understood it – Akash Jp Aug 26 '18 at 05:23
1 Answers
1
In the method, onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)
, you are passing a String
array of permissions that are needed and when the user is asked for all the permissions, the control comes back to this function, where the int[]
array grantResults
contains the status of permissions corresponsding to the string array passed. The grantPermissions
array will contain only PERMISSION_GRANTED
or PERMISSION_DENIED
corresponding to the string array of permissions.

Nikhil Bansal
- 187
- 2
- 11