1

Can anyone explain why onRequestPermisionRequest is created and what is the use of grant results which is passed as argument in Java for Android?

ggorlen
  • 44,755
  • 7
  • 76
  • 106
Akash Jp
  • 162
  • 1
  • 10

1 Answers1

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