Is it possible to send message to a specific contact through whatsapp
directly from another app? I know the contact ID. I don\'t want to open whatsapp
Please try this,
public void onClickWhatsApp(View view) {
Intent waIntent = new Intent(Intent.ACTION_SEND);
waIntent.setType("text/plain");
String text = "YOUR TEXT HERE";
waIntent.setPackage("com.whatsapp");
if (waIntent != null) {
waIntent.putExtra(Intent.EXTRA_TEXT, text);//
startActivity(Intent.createChooser(waIntent, "Share with"));
} else {
Toast.makeText(this, "WhatsApp not Installed", Toast.LENGTH_SHORT)
.show();
}
}
Source : Please check this answer for further details