How can I send message to specific contact through WhatsApp from my android app?
问题 I am developing an android app and I need to send a message to specific contact from WhatsApp. I tried this code: Uri mUri = Uri.parse("smsto:+999999999"); Intent mIntent = new Intent(Intent.ACTION_SENDTO, mUri); mIntent.setPackage("com.whatsapp"); mIntent.putExtra("sms_body", "The text goes here"); mIntent.putExtra("chat",true); startActivity(mIntent); The problem is that the parameter "sms_body" is not received on WhatsApp, though the contact is selected. 回答1: Try using Intent.EXTRA_TEXT