Last active
September 28, 2018 17:26
-
-
Save felipebelluco/cc61037e80ce79498a26fcad80cc7090 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.never_ask_again_message) | |
setTitle(R.string.never_ask_again_title) | |
setPositiveButton(R.string.go_to_settings) { d, i -> | |
// Cria intent para a tela de detalhes do app onde é possível o usuário conceder permissão à funcionalidade | |
val appSettings = Intent().apply { | |
action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS | |
data = Uri.fromParts("package", thisActivity.packageName, null) | |
} | |
startActivity(appSettings) | |
} | |
setNegativeButton(R.string.no) { d, i -> d.dismiss() } | |
}.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment