Created
September 28, 2018 15:04
-
-
Save felipebelluco/c754fe1c2aa491a5e6b0d62c989f43bd 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
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) { | |
// Verifica se o usuário já negou acesso a permisão | |
if (shouldShowRequestPermissionRationale(Manifest.permission.CALL_PHONE)) { | |
// Usuário negou acesso | |
// Mostrar uma dialog explicando a importância do app ter acesso a funcionalidade | |
} else { | |
// Usuário não negou acesso ou negou e marcou a caixa de "não perguntar novamente" | |
// Fazer a requisição da permissão | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment