Contact

data class Contact(    val displayName: String,     val initials: String = "",     val givenName: String = "",     val familyName: String = "",     val companyName: String,     val phoneNumbers: List<PhoneNumber>,     val defaultPhoneNumberIndex: Int,     val addresses: List<Address>,     val defaultAddressIndex: Int,     val source: ContactSource? = null,     val favorite: Boolean,     val image: DrawableResolver? = null,     val primarySortKey: String,     val alternativeSortKey: String) : Parcelable

Encapsulates an address book contact.

Constructors

Link copied to clipboard
fun Contact(    displayName: String,     initials: String = "",     givenName: String = "",     familyName: String = "",     companyName: String,     phoneNumbers: List<PhoneNumber>,     defaultPhoneNumberIndex: Int,     addresses: List<Address>,     defaultAddressIndex: Int,     source: ContactSource? = null,     favorite: Boolean,     image: DrawableResolver? = null,     primarySortKey: String,     alternativeSortKey: String)

Properties

Link copied to clipboard
val addresses: List<Address>

List of addresses for the contact.

Link copied to clipboard
val alternativeSortKey: String

The alternative sort key used when a list of contacts is sorted.

Link copied to clipboard
val companyName: String

The name of the company associated with this contact.

Link copied to clipboard
val defaultAddressIndex: Int

The index of the default address. This is an index in the addresses list.

Link copied to clipboard
val defaultPhoneNumberIndex: Int

The index of the default phone number. This is an index of the phoneNumbers list.

Link copied to clipboard
val displayName: String

Name of the contact.

Link copied to clipboard
val familyName: String

Family name of the contact. This is the last name of a contact if the name is in Western style. See also FullNameStyle. This is an empty string if the contact does not have a family name set in the address book.

Link copied to clipboard
val favorite: Boolean

True when the contact is set as a favorite, false otherwise.

Link copied to clipboard
val givenName: String

Given name of the contact. This is typically the contact's first name in Western names. See also FullNameStyle. This is an empty string if the contact does not have a given name set in the address book.

Link copied to clipboard
val image: DrawableResolver? = null

An image associated with this contact, if available, or null if there is no image available.

Link copied to clipboard
val initials: String

Initials of the contact.

Link copied to clipboard
val phoneNumbers: List<PhoneNumber>

List of phone numbers of the contact.

Link copied to clipboard
val primarySortKey: String

The primary sort key used when a list of contacts is sorted.

Link copied to clipboard
val source: ContactSource? = null

The source from which this contact originates, or null if unknown.

Functions

Link copied to clipboard
open override fun toString(): String

Inherited functions

Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)