Hi, I am showing the user a window with a list of sound, video and audio files.
I want the user to click on any of them and be able to "send to / share" and "gmail, telegram, whatsapp, protonmail, etc." is displayed.
Summarizing, my doubt is:
When the user selects "share", how do I show those programs so he can choose one of them?
Thank you.
Dim FileToSend As String = "card.jpg"
Dim i As Intent
i.Initialize(i.ACTION_SEND,"")
i.SetType("image/jpg") 'JPEG
'i.SetType("video/*") 'MP4
i.SetComponent("") 'empty: show all the programs that can be share the image, video...
i.PutExtra("android.intent.extra.STREAM", Starter.Provider.GetFileUri(FileToSend))
Dim FileToSend As String = "card.jpg"
Dim i As Intent
i.Initialize(i.ACTION_SEND,"")
i.SetType("image/jpg") 'JPEG
'i.SetType("video/*") 'MP4
i.SetComponent("") 'empty: show all the programs that can be share the image, video...
i.PutExtra("android.intent.extra.STREAM", Starter.Provider.GetFileUri(FileToSend))
Hi, thanks, I have tried and it doesn't work, it doesn't do anything, it doesn't show any message and it doesn't show any error, nothing at all.
I am using this code:
B4X:
Sub SendTo( cFile As String )
' copy to share dir
File.Copy(ShCode.cDirMedia,cFile, ShCode.cDirShared,cFile)
' share
Dim i As Intent
i.Initialize(i.ACTION_SEND,"")
i.SetType("image/png")
i.SetComponent("")
i.PutExtra("android.intent.extra.STREAM",Starter.Provider.GetFileUri(cFile))
End Sub
I don't know if it's correct to use that with B4XPages, or maybe you have to use something else.
Thanks.
B4X:
Sub SendTo( cFile As String )
' copy to share dir
File.Copy(ShCode.cDirMedia,cFile, ShCode.cDirShared,cFile)
' share
Dim i As Intent
i.Initialize(i.ACTION_SEND,"")
i.SetType("image/png")
i.SetComponent("")
i.PutExtra("android.intent.extra.STREAM",Starter.Provider.GetFileUri(cFile))
StartActivityForResult( i )
End Sub