Skip to content

Instantly share code, notes, and snippets.

@olcayertas
Created September 10, 2015 09:30
Show Gist options
  • Save olcayertas/148612ed515612340078 to your computer and use it in GitHub Desktop.
Save olcayertas/148612ed515612340078 to your computer and use it in GitHub Desktop.
int pAccessFineLocation =
ContextCompat.checkSelfPermission(
context, Manifest.permission.ACCESS_FINE_LOCATION);
int pAccessCoarseLocation =
ContextCompat.checkSelfPermission(
context, Manifest.permission.ACCESS_COARSE_LOCATION);
if (pAccessFineLocation == PackageManager.PERMISSION_GRANTED
&& pAccessCoarseLocation == PackageManager.PERMISSION_GRANTED) {
//Yay! We have permission!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment