Use Android Contacts app to edit a raw contact which was added by a custom ContentProvider

点点圈 提交于 2019-12-04 12:44:21

You need to add EditSchema to your contact.xml file and add meta-data, pointing to that file in SyncService section of your manifest file, like this:

<service
    android:name=".syncadapter.SyncService"
    android:exported="true">

    <intent-filter>
        <action android:name="android.content.SyncAdapter" />
    </intent-filter>

    <meta-data
        android:name="android.content.SyncAdapter"
        android:resource="@xml/syncadapter" />
    <meta-data
        android:name="android.provider.CONTACTS_STRUCTURE"
        android:resource="@xml/contacts" />
</service>

Here is example of EditSchema in official sources: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.2.2_r1/packages/apps/Contacts/tests/res/xml/test_basic_contacts.xml/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!