应用程序的预定义动作。从联系人链接到我的应用程序 [英] Predefined actions of application. Link to my application from Contacts
问题描述
情景:
- 输入电话联系人
-
我们选择联系人项目
-
我的应用程序的图标应该出现在QuickAction对话框中。
- 我点击了我的应用程序图标,Aplication从联系人记录中的数据开始。
我必须添加到AndroidManifest才能做到这一点?
为您的应用添加此意图过滤器,以便所有联系人都可以看到。
< 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>
更改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
这篇关于应用程序的预定义动作。从联系人链接到我的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!