Created
February 17, 2020 03:15
-
-
Save PatilSiddhesh/6e198a2bda2c24caa0813d9ad7dec181 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
/** | |
* Shows rationale dialog for displaying why the app needs permission | |
* Only shown if the user has denied the permission request previously | |
*/ | |
private fun showRationaleDialog( | |
title: String, | |
message: String, | |
permission: String, | |
requestCode: Int | |
) { | |
val builder: AlertDialog.Builder = AlertDialog.Builder(this) | |
builder.setTitle(title) | |
.setMessage(message) | |
.setPositiveButton("Ok", { dialog, which -> | |
requestPermissions(arrayOf(permission), requestCode) | |
}) | |
builder.create().show() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment