【问题标题】:Android share intent issueAndroid共享意图问题
【发布时间】:2014-02-21 04:17:57
【问题描述】:

我正在尝试使用共享意图,但我认为它无法正常工作。在共享应用程序列表中,Facebook 或 Pinterest 不会出现,但 Gmail 或 Cloud Print 会出现。 我希望所有可能的应用程序都出现在那里。

这是我的代码。 感谢您的任何建议。

final Intent shareIntent = new Intent(Intent.ACTION_SEND);   
    shareIntent.setType("text/plain");   
    shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "App name");
    shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "");
    startActivity(Intent.createChooser(shareIntent, "Share via..."));

【问题讨论】:

  • 根据定义,所有可能的应用程序出现在那里。并非每个应用程序都设置为共享纯文本。
  • 哦...我不知道,谢谢您的解释
  • 有关使用 Intent 进行 Facebook 共享的更多信息:stackoverflow.com/questions/7545254/…(例如,如果您想共享链接,您仍然可以使用普通 Intent 进行操作,无需 Facebook SDK。)
  • Pinterest 应用确实不支持ACTION_SEND,但事实证明,可以使用普通的 Android 意图分享到 Pinterest正好。我在这里记录了它:stackoverflow.com/a/28197134/56285

标签: java android share


【解决方案1】:

我不了解 Pinterest,但对于 Facebook 来说,这似乎是一个已知问题,它不接受这些意图。

Facebook 提供了它的 SDK:https://github.com/facebook/facebook-android-sdk

我猜 Pinterest 也是这样做的,因为他们也提供了他们的 SDK:https://developers.pinterest.com/android/

【讨论】:

    猜你喜欢
    • 2019-01-09
    • 1970-01-01
    • 2023-04-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多