Hello,
With the Intent method, I know how to share a text composed with :
But, how to share a text file (MyFile.TXT) located in DirRootExternal, with the Intent method ?
Thank you.
With the Intent method, I know how to share a text composed with :
B4X:
dim share as intent
share.Initialize(share.ACTION_SEND,"")
share.SetType("text/plain")
share.PutExtra("android.intent.extra.TEXT", mytext)
share.WrapAsIntentChooser("Share text via")
StartActivity(share)
But, how to share a text file (MyFile.TXT) located in DirRootExternal, with the Intent method ?
B4X:
dim i as Intent
dim sFile as String
dim sFullPath as String
dim URI as String
sFile="MyFile.TXT"
sFullPath=File.Combine( File.DirRootExternal ,sFile)
URI = "file://" & sFullPath
i.Initialize(i.ACTION_SEND, "")
i.SetType("text/plain")
i.PutExtra("android.intent.extra.STREAM", URI) ' < didn't work : how to do ?
i.WrapAsIntentChooser("Share via")
StartActivity(i)
Thank you.