The following code works perfectly with Android 5 but not with Android 8 or 9
I tried using FileProvider, without success
I add that FileProvider also uses it in another part of the app and works perfectly.
How to solve?
Thanks in advance
B4X:
File.WriteString(File.DirRootExternal,"msg2.txt","test")
ftp.Initialize("FTP", Host, 21, Username,Password)
ftp.UploadFile(File.DirRootexternal,"msg2.txt", True, IndirizzoFTP & "/msg2.txt")
I tried using FileProvider, without success
B4X:
Dim FileName As String
FileName="msg2.txt"
ftp.Initialize("FTP", Host, 21, Username,Password)
File.Copy(File.DirRootExternal, FileName, Starter.Provider.SharedFolder, FileName)
ftp.UploadFile(File.DirRootexternal,Starter.Provider.GetFileUri(FileName), True, IndirizzoFTP & "/msg2.txt")
I add that FileProvider also uses it in another part of the app and works perfectly.
B4X:
' WhatsApp
Dim FileName As String = NomeImmagine
File.Copy(File.DirRootExternal, FileName, Starter.Provider.SharedFolder, FileName)
'----
i.Initialize(i.ACTION_SEND, "")
i.PutExtra("android.intent.extra.TEXT", "Orario " & Titolo)
i.SetType("text/plain")
i.PutExtra("android.intent.extra.STREAM", Starter.Provider.GetFileUri(FileName))
i.SetType("image/*")
Dim jo As JavaObject = i
jo.RunMethod("setPackage", Array("com.whatsapp"))
StartActivity(i)
Thanks in advance