Person

open class Person
kotlin.Any
   ↳ androidx.core.app.Person

Provides an immutable reference to an entity that appears repeatedly on different surfaces of the platform. For example, this could represent the sender of a message.

Summary

Nested classes

open

Builder for the immutable Person class.

Public methods

open static Person
fromBundle(@NonNull bundle: Bundle)

Extracts and returns the Person written to the bundle.

open IconCompat?

Returns the icon for this Person or null if no icon was provided.

open String?

Returns the key for this Person or null if no key was provided.

open CharSequence?

Returns the name for this Person or null if no name was provided.

open String?

Returns the raw URI for this Person or null if no URI was provided.

open Boolean

Returns whether or not this Person is a machine rather than a human.

open Boolean

Returns whether or not this Person is important to the user of this device with regards to how frequently they interact.

open Person.Builder

Creates and returns a new Builder initialized with this Person's data.

open Bundle

Writes and returns a new Bundle that represents this Person.

Public methods

fromBundle

@NonNull open static fun fromBundle(@NonNull bundle: Bundle): Person

Extracts and returns the Person written to the bundle. A bundle can be created from a Person using toBundle().

getIcon

@Nullable open fun getIcon(): IconCompat?

Returns the icon for this Person or null if no icon was provided.

getKey

@Nullable open fun getKey(): String?

Returns the key for this Person or null if no key was provided. This is provided as a unique identifier between other Persons.

getName

@Nullable open fun getName(): CharSequence?

Returns the name for this Person or null if no name was provided. This could be a full name, nickname, username, etc.

getUri

@Nullable open fun getUri(): String?

Returns the raw URI for this Person or null if no URI was provided. A URI can be any of the following:

*Note for these schemas, the path portion of the URI must exist in the contacts database in their appropriate column, otherwise the reference should be discarded.

isBot

open fun isBot(): Boolean

Returns whether or not this Person is a machine rather than a human. Used primarily to identify automated tooling.

isImportant

open fun isImportant(): Boolean

Returns whether or not this Person is important to the user of this device with regards to how frequently they interact.

toBuilder

@NonNull open fun toBuilder(): Person.Builder

Creates and returns a new Builder initialized with this Person's data.

toBundle

@NonNull open fun toBundle(): Bundle

Writes and returns a new Bundle that represents this Person. This bundle can be converted back by using fromBundle(Bundle).