Using Android Intent system we can share on whats app from our application. Whats App application have listeners that listen to intents to share media and texts.
Simply create an intent to share text, for example, and WhatsApp will be displayed by the system picker:
Intent sendIntent = new Intent();
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
However, if you want to share directly to WhatsApp and bypass the system picker, you can do so by using setPackage in your intent:
This would simply be set right before you call startActivity(sendIntent); Note:- Make sure that you have whats app installed in your device before calling the above Intent