I can add to contact phone number but I can't set number type like mobile or home. And type always set custom.
Here code that I am using:
void AddPhoneToContact(List ops, int rawContactInsertIndex, string phone, string title)
{
ops.Add(GetCreateContactBuilder(rawContactInsertIndex)
.WithValue(ContactsContract.Data.InterfaceConsts.Mimetype, ContactsContract.CommonDataKinds.Phone.ContentItemType)
.WithValue(ContactsContract.CommonDataKinds.Phone.Number, phone) // Number of the person
.WithValue(ContactsContract.CommonDataKinds.Phone.InterfaceConsts.Type, "Home")
.WithValue(ContactsContract.CommonDataKinds.Phone.InterfaceConsts.Label, "Home")
.Build());
}
What am I doing wrong?
Answers
You can try the following code:
Note: Just to change
to