Created
September 28, 2018 15:06
-
-
Save felipebelluco/b947f40b42cb34924eafe14831d2eb96 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
AlertDialog.Builder(thisActivity).apply { | |
setMessage(R.string.more_info_dialog_message) | |
setTitle(R.string.more_info_dialog_title) | |
setPositiveButton(R.string.yes_please) { d, i -> | |
// Se o usuário quiser, requere novamente permissão à funcionalidade | |
ActivityCompat.requestPermissions( | |
thisActivity, | |
arrayOf(Manifest.permission.CALL_PHONE), | |
CALL_PHONE_RESULT_CODE) | |
} | |
// Se o usuário optar por não conceder a permissão, fecha a dialog | |
setNegativeButton(R.string.no_thanks) { d, i -> d.dismiss() } | |
}.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment