【问题标题】:Facebook share with intent - workaround neededFacebook 有意分享 - 需要解决方法
【发布时间】:2013-08-22 07:54:16
【问题描述】:

我正在尝试通过 Android 中的客户端共享一些信息。 此代码在 Gmail、Evernote、Twitter、Viber、Whatsapp 等中运行良好,但在 Facebook 中无法运行,因为它们不支持 EXTRA_TEXT 字段(aaargh!)。

Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Test message");
sharingIntent.putExtra(Intent.EXTRA_TEXT, text);
startActivity(Intent.createChooser(sharingIntent,"Share using"));

所以我想到了一种可能的解决方案。当用户单击共享按钮时,我会创建一个新对话框,用于在 Facebook 和其他人上共享。使用 Facebook SDK,我可以在 Facebook 上共享文本、图像等。当用户点击“其他”时,除了没有 facebook 应用之外,所有客户端都应显示正常的共享意图。

这可能吗?您还有其他想法来完成这项工作吗?

【问题讨论】:

    标签: android facebook android-intent


    【解决方案1】:

    在 StackOverflow 上查看这个问题。这可以帮助您的方案:

    How to filter specific apps for ACTION_SEND intent (and set a different text for each app)

    【讨论】:

      猜你喜欢
      • 2022-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多