This code allows you to send an image (plus a short text) with WhatsApp :
But it doesn't work with Android 9 !!!
I tried using the "Intent ID" library but was unable to complete the code
I did not find any example of how this library manages to do what is desired.
Warning: I used the INTENT ID library version 1.2 (actually 1.20) which is more recent than version 1.5.
https://www.b4x.com/android/forum/threads/intent-id-share-intents-and-anothers-important-intents.68229/
Thanks in advance for help
B4X:
i.Initialize(i.ACTION_SEND, "")
i.PutExtra("android.intent.extra.TEXT", "Title " & Title)
i.SetType("text/plain")
Dim u As Uri
u.Parse("file://" & File.Combine(File.DirRootExternal, "xxxxxx.jpg"))
i.PutExtra("android.intent.extra.STREAM", u)
i.SetType("image/jpeg")
Dim jo As JavaObject = i
jo.RunMethod("setPackage", Array("com.whatsapp"))
Try
StartActivity(i)
But it doesn't work with Android 9 !!!
I tried using the "Intent ID" library but was unable to complete the code
B4X:
Private INTENT As INTENTID
INTENT.Initialize
INTENT.ShareImage_WhatsApp (File.DirRootExternal,"xxxxxx.jpg)
I did not find any example of how this library manages to do what is desired.
Warning: I used the INTENT ID library version 1.2 (actually 1.20) which is more recent than version 1.5.
https://www.b4x.com/android/forum/threads/intent-id-share-intents-and-anothers-important-intents.68229/
Thanks in advance for help