Last active
September 28, 2018 16:30
-
-
Save felipebelluco/704eae21b753da990812018d33ce0e6b to your computer and use it in GitHub Desktop.
This file contains 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) { | |
CALL_PHONE_RESULT_CODE -> { | |
if (grantResults.isNotEmpty() && grantResults.first() == PackageManager.PERMISSION_GRANTED) { | |
// Permissão foi concedida, já é possível usufruir da funcionalidade | |
} else { | |
// Usuário negou acesso à permissão | |
// Bloquear trecho que utilizava a funcionalidade ou informar o usuário da necessidade de ter acesso à funcionalidade | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment