How can I open WhatsApp's conversation activity using contact data?

后端 未结 5 1298
我寻月下人不归
我寻月下人不归 2020-12-09 22:57

I want open what\'s app conversation activity cmp=com.whatsapp/.Conversation from my app.

How can I do this? I have contact phone number, contact id, c

5条回答
  •  被撕碎了的回忆
    2020-12-09 23:25

    try this code :

    String smsNumber="919426640584@s.whatsapp.net";
    Uri uri = Uri.parse("smsto:" + smsNumber);
    Intent i = new Intent(Intent.ACTION_SENDTO, uri);
    i.putExtra("sms_body", "Prakash Gajera");
    i.setPackage("com.whatsapp");
    startActivity(i);
    

提交回复
热议问题