Created
June 5, 2020 12:35
-
-
Save TheBotBox/85faf38f858148dfdb7694b6f4b76c1b 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
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