0
 Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
        sharingIntent.setType("text/plain");
        sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject Here");
        sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "SHARE BODY https://www.messenger.com");
        startActivity(Intent.createChooser(sharingIntent, "HUO"));

This text will be shared correctly for other apps, but messenger will only share the URL. Why? How can I fix this?

Boldijar Paul
  • 5,405
  • 9
  • 46
  • 94
  • 2
    Because Facebook doesn't want you to prefill text. We want the user to type the text. So there is nothing you can do to change it – WizKid Jul 01 '16 at 10:11

1 Answers1

1

This text will be shared correctly for other apps

Some apps might support that. Apps do not have to, as what you are doing (using both EXTRA_TEXT and EXTRA_STREAM) is outside the scope of the ACTION_SEND contract. You are supposed to use either EXTRA_TEXT or EXTRA_STREAM, not both.

How can I fix this?

Get rid of EXTRA_TEXT, or get rid of EXTRA_STREAM, or live with random results from apps with your existing Intent structure.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491