Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 1.0.0
belongs to Maven artifact androidx.core:core:1.0.0-rc01

Person

public class Person
extends Object

java.lang.Object
   ↳ 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

class Person.Builder

Builder for the immutable Person class. 

Public methods

static Person fromBundle(Bundle bundle)

Extracts and returns the Person written to the bundle.

IconCompat getIcon()

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

String getKey()

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

CharSequence getName()

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

String getUri()

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

boolean isBot()

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

boolean isImportant()

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

Person.Builder toBuilder()

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

Bundle toBundle()

Writes and returns a new Bundle that represents this Person.

Inherited methods

Public methods

fromBundle

added in version 1.0.0
public static Person fromBundle (Bundle bundle)

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

Parameters
bundle Bundle

Returns
Person

getIcon

added in version 1.0.0
public IconCompat getIcon ()

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

Returns
IconCompat

getKey

added in version 1.0.0
public String getKey ()

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

Returns
String

getName

added in version 1.0.0
public CharSequence getName ()

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

Returns
CharSequence

getUri

added in version 1.0.0
public String getUri ()

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.

Returns
String

isBot

added in version 1.0.0
public boolean isBot ()

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

Returns
boolean

isImportant

added in version 1.0.0
public boolean isImportant ()

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

Returns
boolean

toBuilder

added in version 1.0.0
public Person.Builder toBuilder ()

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

Returns
Person.Builder

toBundle

added in version 1.0.0
public Bundle toBundle ()

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

Returns
Bundle