Unable to share text with a link through Android S

2019-01-25 18:49发布

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.

2条回答
来,给爷笑一个
2楼-- · 2019-01-25 18:51

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

查看更多
我命由我不由天
3楼-- · 2019-01-25 18:57

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..

查看更多
登录 后发表回答