this will be my last question (for this year).
I tired it but got this manifest error:
Packaging files. Error
AndroidManifest.xml:22: error: No resource identifier found for attribute 'requestLegacyExternalStorage' in package 'android'
In my code users receive
sometext.csv as email attachment and are asked to simply save this, which puts it into the download folder to be picked up by my app.
Without that line in manifest I can see that the file exists but when trying to list all files, the fileList throws an error.
Dim A As String = "/storage/emulated/0/Download"
Dim B = Starter.rp.GetSafeDirDefaultExternal("Download")
Log("Dir A, B = "&A&" >> "&B)
If File.Exists(A,"sometext.csv") = True Then
Log("FOUND IT")
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_READ_EXTERNAL_STORAGE)
Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean)
If Result=True Then
Log("Permission granted")
End If
Try
Dim fileList As List
fileList.Initialize
Log("Show all in "&A)
fileList = File.ListFiles(A)
For i = 0 To fileList.Size-1
Log(fileList.Get(i))
Next
Catch
Log("Error = "&LastException.message) ' = java.lang.RuntimeException: Object should first be initialized (List).
End Try
Else
Log("you goofed it up again")
End If
Does anyone know what I've done wrong?
Thanks for your help and happy beforexing in 2021!
john m.