Hi all.
If you send message with intent / WhatsApp write this code:
and all work. But if i want send to specific contact i found this code:
this is website: http://stackoverflow.com/questions/19081654/send-text-to-specific-contact-whatsapp
i Try in this mode but dont work, this is code:
i try also this:
Any idea ??
Thank you in advance
If you send message with intent / WhatsApp write this code:
B4X:
Dim i As Intent
i.Initialize(i.ACTION_SEND,"")
i.SetType("text/plain")
i.SetComponent("com.whatsapp/.ContactPicker")
i.PutExtra("android.intent.extra.TEXT","HELLO")
StartActivity(i)
and all work. But if i want send to specific contact i found this code:
B4X:
Uri uri = Uri.parse("smsto:" + smsNumber);
Intent i = new Intent(Intent.ACTION_SENDTO, uri);
i.putExtra("sms_body", smsText);
i.setPackage("com.whatsapp");
startActivity(i);
this is website: http://stackoverflow.com/questions/19081654/send-text-to-specific-contact-whatsapp
i Try in this mode but dont work, this is code:
B4X:
Dim i As Intent
Dim smsNumber As String = "+393889XXXXXX"
Dim numero As Uri
numero.Parse("smsto:" & smsNumber)
i.Initialize(i.ACTION_SEND, numero)
i.SetType("text/plain")
i.SetComponent("com.whatsapp")
i.PutExtra("android.intent.extra.TEXT","HELLO")
StartActivity(i)
i try also this:
B4X:
.....
numero.Parse("smsto:" & smsNumber)
i.Initialize(i.ACTION_SEND, numero)
i.SetType("text/plain")
Dim jo As JavaObject = i
jo.RunMethod("setPackage", Array As Object("com.whatsapp"))
i.PutExtra("android.intent.extra.TEXT","HELLO")
StartActivity(i)
Any idea ??
Thank you in advance
Last edited: