How to add postal address to contacts in android programmaticaly?

后端 未结 2 340
谎友^
谎友^ 2021-01-28 07:40

I am developing app which add contact info to android contact list .to How to add postal address to contacts in android programmatically ?

2条回答
  •  盖世英雄少女心
    2021-01-28 07:52

    Postal address are stored like all the other info in the DATA table with a

    MIMEtype == ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE
    

    Please google ContactsContract.CommonDataKinds.StructuredPostalto find all the info.

    If you need to know how to edit a contact in general I would suggest you to have a look to the SampleSyncAdapter in the Android SDK. It is a sync adapter so you don't need to study everything but updateContact in ContactManager is a good point to start with.

提交回复
热议问题