start whatsapp with android.content.Intent.ACTION_SENDTO

限于喜欢 提交于 2019-11-28 04:25:01

问题


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


回答1:


Here is the answer from the whatsapp android support team:



来源:https://stackoverflow.com/questions/6284011/start-whatsapp-with-android-content-intent-action-sendto

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!