predefined应用的行为。链接从名片夹我的应用程序 [英] Predefined actions of application. Link to my application from Contacts

查看:129
本文介绍了predefined应用的行为。链接从名片夹我的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写这是与通讯录连接的应用程序。

方案:

  1. 输入到手机通讯录
  2. 我们选择联系人项目

  3. 在我的应用程序应该出现在QuickAction对话框的

    和图标。

  4. 在我点击我的应用程序图标和Aplication启动与联系人记录数据。

我要补充到AndroidManifest办呢?

解决方案

将此意图过滤器为您的应用程序是为所有联系人可见。

 <意向滤光器>
        <作用机器人:名称=android.intent.action.VIEW/>
        <类机器人:名称=android.intent.category.DEFAULT/>
        <数据机器人:MIMETYPE =vnd.android.cursor.item /名称/>
    &所述; /意图滤光器>
 

更改MIMETYPE,因此,只有与特定数据的联系人有你的活动。

例如,如果你希望你的活动,只显示与电子邮件联系人然后更改MIMETYPE到 vnd.android.cursor.item / email_v2 。您可以从 DataColumns

I want to write application which is connected with Contacts.

Scenario :

  1. Enter to phone Contacts
  2. We choose Contact item

  3. And icon of my application should appear in QuickAction Dialog.

  4. 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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆