Above answer is sufficient for your question.But for other coders this may help :)
For whatsapp :
try {
Intent waIntent = new Intent(Intent.ACTION_SEND);
waIntent.setType("text/plain");
waIntent.setPackage("com.whatsapp");
if (waIntent != null) {
waIntent.putExtra(Intent.EXTRA_TEXT, textToSend);//
startActivity(Intent.createChooser(waIntent, "Share with"));
} else {
Toast.makeText(this, "WhatsApp not Installed", Toast.LENGTH_SHORT)
.show();
}
} catch (Exception e) {
Toast.makeText(ShareActivity.this,"Could not launch WhatsApp.",Toast.LENGTH_SHORT).show();
}
For Message :
try {
Intent sendIntentmsg = new Intent(Intent.ACTION_VIEW);
sendIntentmsg.setData(Uri.parse("sms:"));
sendIntentmsg.putExtra("sms_body", textToSend);
startActivity(sendIntentmsg);
} catch (Exception e) {
Toast.makeText(ShareActivity.this,"Could not launch Messaging App now.",Toast.LENGTH_SHORT).show();
}