Android浏览器共享指向phonegap应用的链接

时间:2013-05-30 20:39:05

标签: android phonegap-build

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

谢谢大家

托马索

1 个答案:

答案 0 :(得分:0)

我不知道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行)你有一个有效的例子。