【问题标题】:Unable to share text with a link through Android Share Intent无法通过 Android Share Intent 与链接共享文本
【发布时间】:2012-12-22 09:59:36
【问题描述】:

现在我想用下面的链接分享文本是我的代码

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"));

所以它适用于 gmail、twitter 等,但它不适用于 facebook

在 facebook 上它只分享链接,但没有显示我的文字

我想要这种类型的分享

www.mylink.com

here is my text

任何帮助将不胜感激, 提前致谢。

【问题讨论】:

标签: android facebook android-intent


【解决方案1】:

您在这里遇到的问题可能是 Facebook 没有查看 Intent 中提供的额外信息。因为它适用于 Gmail 和 Twitter。

顺便看看Android and Facebook share intent..

【讨论】:

    【解决方案2】:

    您无法使用分享意图在 FB 上分享带有文本的链接, 您必须尝试使用​​ FB graph API for wall post 执行此操作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-01-18
      • 2014-08-10
      • 1970-01-01
      • 2019-11-19
      • 1970-01-01
      • 2022-08-17
      • 1970-01-01
      相关资源
      最近更新 更多