Skip to content

Instantly share code, notes, and snippets.

@vestrel00
Created October 7, 2021 20:08
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/26392c08690f541d3c0bd840c557610b to your computer and use it in GitHub Desktop.
Save vestrel00/26392c08690f541d3c0bd840c557610b 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", Kotlinized
val insertResult = Contacts(context)
.insert()
.rawContact {
setName {
givenName = "John"
familyName = "Doe"
}
setOrganization {
company = "Amazon"
title = "Superstar"
}
addEmail {
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