Hi, I have a shared directory:
I try to send an email with a zip attached:
But I always get the error in this Sub:
The error:
Thank you.
B4X:
cDirShared = rp.GetSafeDirDefaultExternal("shared")
B4X:
Message.Attachments.Add( CreateFileProviderUri(cDirShared,cFileZip) )
B4X:
Sub CreateFileProviderUri (Dir As String, FileName As String) As Object
Dim FileProvider As JavaObject
Dim context As JavaObject
context.InitializeContext
FileProvider.InitializeStatic("android.support.v4.content.FileProvider")
Dim f As JavaObject
f.InitializeNewInstance("java.io.File", Array(Dir, FileName))
Return FileProvider.RunMethod("getUriForFile", Array(context, Application.PackageName & ".provider",f))
End Sub
Why?java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/sdcard0/Android/data/conkex.preventa/files/shared/20181125011604presales.ZIP
Thank you.