So currently my manifest looks like this:
`manifest xmlns:android=”http://schemas.android.com/apk/res/android”>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />
<uses-permission android:name="androdi.permission.MANAGE_EXTERNAL_STOARGE"
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.READ_MEDIA_PHOTOS"/>
<uses-permission android:name="android.permission.QUERIES"/>
<!-- Your other manifest elements here -->
`
and the part of my Kotlin code where the error comes up look like this:
`package com.example.myapplication
import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri
import android.widget.EditText
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
class MainActivity : AppCompatActivity() {
private val PICK_FILE_REQUEST_CODE = 1 // Use a unique request code
private fun RequestEXTPERM() {
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.),
READ_EXTERNAL_STORAGE_REQUEST_CODE)
}
private var selectedFileUri: Uri? = null // Store the selected file URI
private fun requestReadExternalStoragePermission() {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE),
READ_EXTERNAL_STORAGE_REQUEST_CODE)
} else {
// Permission already granted, proceed with accessing external storage
}
}`
I tried playing a little with permissions like MANAGE_EXTERNAL_STORAGE and some other you can see in my manifest. But none of those really helped and I am clueless. I am new to the language and will also be really cool if you can send me some links to the tutorials.
I would be really happy for any help
DUMBASS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.