Android Question WhatsApp to specific Number + Text-Message + one more file (image)

JOTHA

Well-Known Member
Licensed User
Longtime User
Hello Forum,
here ist the code to send WhatsApp to specific Number + Text-Message, its simple and it works.
Send WhatsApp to specific Number + Text-Message:
i.Initialize(i.ACTION_VIEW, "https://api.whatsapp.com/send?phone=+49-XXXXXXX&text=Test 1")

But I wonder how I can attach one more file (image) by code?
I have a working code for multiple files, but no solution to combine both codes ...
... to send multiple files with SEND_MULTIPLE:
Dim i As Intent
i.Initialize("android.intent.action.SEND_MULTIPLE", "")
i.SetType("image/png")
Dim Uris As List
Uris.Initialize
Dim Files As List = File.ListFiles(Provider.SharedFolder)
For Each pdffile As String In Files
Dim u As Uri = GetFileUri(pdffile)
Uris.Add(u)
Next
Dim jo As JavaObject = i
jo.RunMethod("putParcelableArrayListExtra", Array As Object("android.intent.extra.STREAM", Uris))
i.Flags = 1
StartActivity(i)

Does anyone have an idea? :)
 
Top