5

now i want to share text with a link below is my code

String myText = "Hey!\nThis is a my Text!";

Intent share = new Intent(Intent.ACTION_SEND);
share.setType("text/plain");
String extraText = "www.mylink.com\n\n" + myText ;
share.putExtra(Intent.EXTRA_TEXT, extraText);
startActivity(Intent.createChooser(share, "Share with Friends"));

so it work work fine with gmail, twitter etc. but it is not working on facebook

on facebook it share only link but there are not shown my text

i want to this type sharing

www.mylink.com

here is my text

Any help would be appreciated, Thanks in Advance.

Jeetu
  • 686
  • 2
  • 10
  • 20
  • possible duplicate of [Android and Facebook share intent](http://stackoverflow.com/questions/7545254/android-and-facebook-share-intent) – Siddharth Lele Dec 22 '12 at 11:19
  • This is my solution which is working fine just for sharing URL on Facebook, http://stackoverflow.com/a/29529335/513413 – Hesam Apr 09 '15 at 03:44
  • [he problem you have here is probably that Facebook doesn't look at the extra information provided in the Intent. Because it works for Gmail and Twitter.](https://stackoverflow.com/questions/34618514/share-text-via-intent-on-facebook-without-using-facebook-sdk) – rahul sondarva Aug 24 '17 at 13:39

2 Answers2

4

The problem you have here is probably that Facebook doesn't look at the extra information provided in the Intent. Because it works for Gmail and Twitter.

Have a look at Android and Facebook share intent by the way..

Community
  • 1
  • 1
ndsmyter
  • 6,535
  • 3
  • 22
  • 37
1

you cant share link with text on FB using Share Intent, You must try to do this the FB graph API for wall post .

Deven
  • 3,078
  • 1
  • 32
  • 34