How to Share Entire Android App with Share Intent

Solution 1:

To add the Facebook, Twitter etc. share options, the user just needs to have those applications installed. It's up to other applications what type of Intents they will tell the system they can handle.

Then a basic ACTION_SEND intent will get picked up.

Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT,
    "Hey check out my app at: https://play.google.com/store/apps/details?id=" + BuildConfig.APPLICATION_ID);
sendIntent.setType("text/plain");
startActivity(sendIntent);

Source

Solution 2:

If you apply this code then it looks like the image below

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, "My application name");
intent.putExtra(Intent.EXTRA_TEXT, "This is my text");
startActivity(Intent.createChooser(intent, "choose one"));

enter image description here

=====================================================================

If you apply this code then it looks like the image below

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

enter image description here

Solution 3:

You can do that by using a sharing intent

            Intent shareIntent = new Intent(Intent.ACTION_SEND);
            shareIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            shareIntent.setType("text/plain");
            shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Hey, download this app!");
            startActivity(shareIntent);     

you can put this intent in an onclick or use it whereever you want

I think this answers your question =)