I want an Intent to take control you directly to WhatsApp. So the moment the user clicks on the button, the Intent is supposed to take you to WhatsApp. This is the code I wrote after following a few guide lines but it doesn't work
buttonWhatsapp.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Performs action on click
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
sendIntent.setPackage("com.whatsapp");
startActivity(Intent.createChooser(sendIntent, ""));
startActivity(sendIntent);
//opens the portfolio details class
}
});