I'm triying to start whatsapp with an android intent:
String uri = "smsto:+123456";
Intent messageIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse(uri));
messageIntent.putExtra("sms_body", "My Message");
startActivity(messageIntent);
It works great if the user picks the normal messaging application. But not if the user selects whatsapp from the chooser. The "compose text field" from whatsapp remains empty.
What am I doing wrong here? Do I need another putExtra()
?
Android intent system Like most social apps on Android, WhatsApp listens to intents to share media and text. Simply create an intent to share text, for example, and WhatsApp will be displayed by the system picker: Intent sendIntent = new Intent(); sendIntent.
com. whatsapp is the package name for official whatsapp application.
Here is the answer from the whatsapp android support team:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With