Hello I'm using this code to ask for permission to read and write but the permission request does not appear, does anyone know how to fix this?
in oncreate
code
setupPermissions()
setupPermissions2()
after oncreate
-
private fun setupPermissions() {
val permission = ContextCompat.checkSelfPermission(context!!,
Manifest.permission.READ_EXTERNAL_STORAGE)
if (permission != PackageManager.PERMISSION_GRANTED) {
Log.i(TAG, "Permission to record denied")
}
}
private fun setupPermissions2() {
val permission = ContextCompat.checkSelfPermission(context!!,
Manifest.permission.WRITE_EXTERNAL_STORAGE)
if (permission != PackageManager.PERMISSION_GRANTED) {
Log.i(TAG, "Permission to record denied")
}
}