开发者

start whatsapp with android.content.Intent.ACTION_SENDTO

开发者 https://www.devze.com 2023-03-11 03:51 出处:网络
I\'m triying to start whatsapp with an android intent: String uri 开发者_运维技巧= \"smsto:+123456\";

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()?


Here is the answer from the whatsapp android support team:

start whatsapp with android.content.Intent.ACTION_SENDTO

0

精彩评论

暂无评论...
验证码 换一张
取 消