hi..
I can't send the text in the text.
I am using this code. does not send the text inside.
I can't send the text in the text.
I am using this code. does not send the text inside.
B4X:
Sub Button1_Click
Dim text As String
text = (File.ReadString(File.DirAssets, Index1 & ".txt"))
File.Copy(File.DirAssets,text , Starter.shared, text)
Dim INTENT As Intent
INTENT.Initialize(INTENT.ACTION_SEND,"")
INTENT.SetType("text/plain")
INTENT.SetComponent("com.whatsapp/.ContactPicker")
INTENT.putExtra("android.intent.extra.TEXT", " ")
INTENT.PutExtra("android.intent.extra.STREAM", CreateFileProviderUri(Starter.shared, text))
StartActivity(INTENT)
End Sub
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
Last edited: