Skip to content

Instantly share code, notes, and snippets.

@talosdev
Created May 29, 2018 08:41
Show Gist options
  • Select an option

  • Save talosdev/41369377cddf17685d1fc6da569ae6f9 to your computer and use it in GitHub Desktop.

Select an option

Save talosdev/41369377cddf17685d1fc6da569ae6f9 to your computer and use it in GitHub Desktop.
@Override
@SuppressWarnings({"MissingPermission"})
public void onRequestPermissionsResult(int requestCode,
@NonNull String[] permissions,
@NonNull int[] grantResults) {
if (requestCode == locationRequestCode) {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
permissionsRequestResultDispatcher.dispatchResult(true);
} else {
permissionsRequestResultDispatcher.dispatchResult(false);
}
} else {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment