Created
February 17, 2020 03:19
-
-
Save PatilSiddhesh/79c8909d1c024c33bb0aec1aa667b5df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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