Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dmitriy-chernysh/4c57475787b2f46c6d1a16897559937c to your computer and use it in GitHub Desktop.
Save dmitriy-chernysh/4c57475787b2f46c6d1a16897559937c to your computer and use it in GitHub Desktop.
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
switch (requestCode) {
case Constants.REQUEST_CODE_ADD_VIDEO_FROM_GALLERY:
boolean isGranted = false;
for (int result : grantResults) {
if (result == PackageManager.PERMISSION_GRANTED) {
isGranted = true;
} else {
isGranted = false;
break;
}
}
if (isGranted) {
//do something
} else {
//show explanation message
}
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment