【发布时间】:2013-05-30 20:39:05
【问题描述】:
我正在开发一个 phongap 构建应用程序。 我需要我的应用出现在 android 浏览器的共享菜单中。 我看到了这个Make Android app listen to shared links,但我在 phonegap-build 上,我没有清单...... 有办法做到这一点吗?我还需要处理对我的应用程序的相对调用:)
谢谢大家
托马索
【问题讨论】:
我正在开发一个 phongap 构建应用程序。 我需要我的应用出现在 android 浏览器的共享菜单中。 我看到了这个Make Android app listen to shared links,但我在 phonegap-build 上,我没有清单...... 有办法做到这一点吗?我还需要处理对我的应用程序的相对调用:)
谢谢大家
托马索
【问题讨论】:
我不知道 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 行)你有一个工作示例。
【讨论】: