【发布时间】:2016-04-28 18:26:59
【问题描述】:
我想让用户能够与其他人共享他们的对象。
我有一个活动,可以使用这样的意图过滤器显示对象信息:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="www.mywebsite.com" />
</intent-filter>
分享代码:
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Constants.EXTRA_OBJECT_ID, id);
shareIntent.putExtra(Constants.EXTRA_IS_LOCAL, false);
shareIntent.putExtra(Intent.EXTRA_TEXT, "http://www.mywebsite.com");
startActivity(Intent.createChooser(shareIntent, "Share link using"));
但是当我点击此链接时,我无法在“使用完成操作”对话框中看到我的应用程序。
【问题讨论】:
标签: android android-intent intentfilter