3
我有一个下列intent filter
:与方案和主机意图过滤器不工作
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="content" android:host="my.company.name" />
</intent-filter>
不过,这并不符合下列Intent
:
Uri uri = new Uri.Builder().scheme("content").authority("my.company.name").appendPath("names").build()
uri = Uri.withAppendedPath(uri, id1);
uri = Uri.withAppendedPath(uri, "data");
startActivity(new Intent(Intent.ACTION_VIEW, uri));
为什么会出现这种情况?
那么它是如何工作的显示与'ACTION_VIEW'和uri像'content:// contacts/people/1'的联系信息?另外,是的,这个问题是相关的,我也计划为'http'方案添加过滤器,但最初我想实现类似于联系人的使用模式。 – Fixpoint 2011-05-22 00:39:56
忽视以前的评论:)看起来系统要求每个注册的内容提供者确定URI的MIME类型并隐含地将该信息添加到意图。所以,添加MIME类型真的解决了这个问题。谢谢! – Fixpoint 2011-05-22 00:45:48