Android Intent Filters for VIEW/EDIT/INSERT Contact

前端 未结 1 823
伪装坚强ぢ
伪装坚强ぢ 2020-12-20 08:22

I\'ve been trying to find one or all of the right filters. Does anyone have them? Down at the bottom you can see the logging output of the intents. Perhaps they aren\'t p

相关标签:
1条回答
  • 2020-12-20 08:28

    This worked for me:

            <intent-filter android:label="Edit Contact">
                <action android:name="android.intent.action.EDIT" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="vnd.android.cursor.item/person"
                    android:host="contacts" />
                <data android:mimeType="vnd.android.cursor.item/contact"
                    android:host="com.android.contacts" />
                <data android:mimeType="vnd.android.cursor.item/raw_contact"
                    android:host="com.android.contacts" />
            </intent-filter>
            <intent-filter android:label="Create Contact">
                <action android:name="android.intent.action.INSERT" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="vnd.android.cursor.dir/person" />
                <data android:mimeType="vnd.android.cursor.dir/contact" />
                <data android:mimeType="vnd.android.cursor.dir/raw_contact" />
            </intent-filter>
            <intent-filter android:label="View Contact">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="vnd.android.cursor.item/person"
                    android:host="contacts" />
                <data android:mimeType="vnd.android.cursor.item/contact"
                    android:host="com.android.contacts" />
                <data android:mimeType="vnd.android.cursor.item/raw_contact"
                    android:host="com.android.contacts" />
            </intent-filter>
    
    0 讨论(0)
提交回复
热议问题