qax
qax

Reputation: 109

How to customize share intent?

I have a share button already integrated to my app but instead of sharing the link (I am using Webview) instead I want to share a custom text for example "To get more facts download the APPNAME from the android store PLAYSTORELINK"

    private void sharePost() {
        Intent shareIntent = new Intent(Intent.ACTION_SEND);
        shareIntent.setType("text/plain");
        shareIntent.putExtra(Intent.EXTRA_TEXT, mUri);
        startActivity(Intent.createChooser(shareIntent, getString(R.string.share_chooser_method)));
    }
}

Upvotes: 1

Views: 153

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007554

Replace:

shareIntent.putExtra(Intent.EXTRA_TEXT, mUri);

with:

shareIntent.putExtra(Intent.EXTRA_TEXT, "To get more facts download the APPNAME from the android store PLAYSTORELINK");

Upvotes: 1

Related Questions