Created
July 9, 2019 16:53
-
-
Save dmitriy-chernysh/4c57475787b2f46c6d1a16897559937c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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