Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active February 11, 2019 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/207a6c8dd60b8ac8f7810a385d043095 to your computer and use it in GitHub Desktop.
Save parzibyte/207a6c8dd60b8ac8f7810a385d043095 to your computer and use it in GitHub Desktop.
// Recuerda: MainActivity es el nombre de tu actividad
int estadoDePermiso = ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CAMERA);
if (estadoDePermiso == PackageManager.PERMISSION_GRANTED) {
// Aquí el usuario dio permisos para acceder a la cámara
} else {
// Si no, entonces pedimos permisos...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment