Advertisement
Guest User

Untitled

a guest
Aug 28th, 2015
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. if(Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1) {
  2. boolean hasPermission = checkSelfPermission(Manifest.permission.XX)
  3. == PackageManager.PERMISSION_GRANTED;
  4. if(!hasPermission) {
  5. if(shouldShowRequestPermissionRationale(Manifest.permission.XX)) {
  6. // explain reason for permission, try again
  7.  
  8. } else {
  9. // user deny with "don't show again"
  10. }
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement