【问题标题】:Android browser share link to phonegap appAndroid 浏览器分享到 phonegap 应用程序的链接
【发布时间】:2013-05-30 20:39:05
【问题描述】:

我正在开发一个 phongap 构建应用程序。 我需要我的应用出现在 android 浏览器的共享菜单中。 我看到了这个Make Android app listen to shared links,但我在 phonegap-build 上,我没有清单...... 有办法做到这一点吗?我还需要处理对我的应用程序的相对调用:)

谢谢大家

托马索

【问题讨论】:

    标签: android phonegap-build


    【解决方案1】:

    我不知道 phonegap 是如何工作的,但如果你有一个 Activity,那么你可以使用以下代码:

    Intent sendIntent = new Intent();
    sendIntent.setAction(Intent.ACTION_SEND);
    sendIntent.putExtra(Intent.EXTRA_TEXT, "A text to share");
    sendIntent.setType("text/plain");
    startActivity(Intent.createChooser(sendIntent, "Share via"));
    

    检查Android's documentation for sending content to other apps

    Here in method shareList(在第 406 行)你有一个工作示例。

    【讨论】:

    • 感谢您的回复,但我不知道如何在 phonegap 中使用您的信息。
    • 没关系!你有没有在这里检查过这个答案? phonegap-share-functionality-to-email-twitter-and-facebook;也检查this link
    • 我认为 OP 希望他的应用程序接收共享意图,而不是发送它? (实际上,我也在寻找这个:D)
    • 哦,那样的话你们两个需要的是this link(可能有一些有用的东西你也可以在PhoneGap中使用)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-19
    相关资源
    最近更新 更多