Java – How to send an app invitation from my app (via whatsapp, hike, message)

How to send an app invitation from my app (via whatsapp, hike, message)… here is a solution to the problem.

How to send an app invitation from my app (via whatsapp, hike, message)

I’m new to Android. I created a simple food app. I want to send an invitation from my app to my friend via Whatsapp, messages, etc. when I click the invite button. I don’t know anything about it. Can you guide me (showing some examples would be more helpful for me).

Thanks in advance!

Solution

Refer this link

Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(sendIntent);

Related Problems and Solutions