Skip to content

Instantly share code, notes, and snippets.

@vestrel00
Last active December 18, 2021 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vestrel00/2d1e716587de104d7ba0d46923c6a353 to your computer and use it in GitHub Desktop.
Save vestrel00/2d1e716587de104d7ba0d46923c6a353 to your computer and use it in GitHub Desktop.
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(NewRawContact().apply {
name = NewName().apply {
givenName = "John"
familyName = "Doe"
}
organization = NewOrganization().apply {
company = "Amazon"
title = "Superstar"
}
emails.add(NewEmail().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