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

List of addresses for the contact.

Link copied to clipboard

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

Link copied to clipboard

The name of the company associated with this contact.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Name of the contact.

Link copied to clipboard

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

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

Link copied to clipboard

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

Initials of the contact.

Link copied to clipboard

List of phone numbers of the contact.

Link copied to clipboard

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)