Android onRequestPermissionsResult grantResults size > 1
No, It is not a good way to just check first permission, it might be possible that user have allowed first permission but denied for rest permissions. Here is function i am sharing to check whether all permissions are granted or not
public boolean hasAllPermissionsGranted(@NonNull int[] grantResults) {
for (int grantResult : grantResults) {
if (grantResult == PackageManager.PERMISSION_DENIED) {
return false;
}
}
return true;
}
and in your onRequestPermissionsResult
if(hasAllPermissionsGranted(grantResults)){
// all permissions granted
}else {
// some permission are denied.
}