Skip to content

Instantly share code, notes, and snippets.

@PatilSiddhesh
Created February 17, 2020 03:19
Show Gist options
  • Save PatilSiddhesh/79c8909d1c024c33bb0aec1aa667b5df to your computer and use it in GitHub Desktop.
Save PatilSiddhesh/79c8909d1c024c33bb0aec1aa667b5df to your computer and use it in GitHub Desktop.
override fun onRequestPermissionsResult(
requestCode: Int,
permissions: Array<out String>,
grantResults: IntArray
) {
when (requestCode) {
REQUEST_CONTACTS_STATE -> {
if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
Toast.makeText(this, "Permission granted", Toast.LENGTH_SHORT).show()
} else {
Toast.makeText(this, "Permission denied", Toast.LENGTH_SHORT).show()
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment