Search code examples
androidandroid-contactsintentfilter

What is the mimeType from adding an intent filter for sharing a contact?


How do I register my app as one that can share contact information?

For example, registering as an app that shares pictures is done this way:

<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="image/*" />
</intent-filter>

I googled it, and I was not able to find a "contacts" mimType


Solution

  • Contacts are usually represented as vcards so the mime type would be set as:

    <data android:mimeType="text/x-vcard" />
    

    But Google has a contact specific item type:

    <data android:mimeType="vnd.android.cursor.item/contact" />