predefined应用的行为。链接从名片夹我的应用程序 [英] Predefined actions of application. Link to my application from Contacts
问题描述
我想写这是与通讯录连接的应用程序。
方案:
- 输入到手机通讯录
-
我们选择联系人项目
- 在我的应用程序应该出现在QuickAction对话框的
和图标。
- 在我点击我的应用程序图标和Aplication启动与联系人记录数据。
我要补充到AndroidManifest办呢?
将此意图过滤器为您的应用程序是为所有联系人可见。
<意向滤光器>
<作用机器人:名称=android.intent.action.VIEW/>
<类机器人:名称=android.intent.category.DEFAULT/>
<数据机器人:MIMETYPE =vnd.android.cursor.item /名称/>
&所述; /意图滤光器>
更改MIMETYPE,因此,只有与特定数据的联系人有你的活动。
例如,如果你希望你的活动,只显示与电子邮件联系人然后更改MIMETYPE到 vnd.android.cursor.item / email_v2
。您可以从 DataColumns 类的子类得到MIMETYPE名P>
I want to write application which is connected with Contacts.
Scenario :
- Enter to phone Contacts
We choose Contact item
And icon of my application should appear in QuickAction Dialog.
- I click on my app icon and Aplication start with data from contact record.
What I have to add to AndroidManifest to do it?
Add this intent filter for your app to be visible for all contacts.
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/name" />
</intent-filter>
Change the mimetype, so that only contacts with a particular data have your activity.
e.g if you want your activity to show only for contacts with email then change mimetype to vnd.android.cursor.item/email_v2
. You can get the mimetype names from the subclasses of DataColumns
这篇关于predefined应用的行为。链接从名片夹我的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!