Skip to content

Instantly share code, notes, and snippets.

@TheBotBox
Created June 5, 2020 12:35
Embed
What would you like to do?
fun AppCompatActivity.hasPermissions(vararg permissions: String): Boolean {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
permissions.all { singlePermission ->
applicationContext.checkSelfPermission(singlePermission) == PackageManager.PERMISSION_GRANTED
}
else true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment