Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CREATE/INSERT a contact with a name of "John Doe" who works at Amazon with a work email of "john.doe@amazon.com"
val insertResult = Contacts(context)
.insert()
.rawContacts(MutableRawContact().apply {
name = MutableName().apply {
givenName = "John"
familyName = "Doe"
}
organization = MutableOrganization().apply {
company = "Amazon"
title = "Superstar"
}
emails.add(MutableEmail().apply {
address = "john.doe@amazon.com"
type = Email.Type.WORK
})
})
.commit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment