Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

Person

public final class Person
extends Object implements Parcelable

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

Inherited constants

Fields

public static final Creator<Person> CREATOR

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

Icon getIcon()
String getKey()
CharSequence getName()
String getUri()
boolean isBot()
boolean isImportant()
Person.Builder toBuilder()

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

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Fields

CREATOR

added in API level 28
public static final Creator<Person> CREATOR

Public methods

describeContents

added in API level 28
public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

getIcon

added in API level 28
public Icon getIcon ()

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

getKey

added in API level 28
public String getKey ()

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

getName

added in API level 28
public CharSequence getName ()

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

getUri

added in API level 28
public String getUri ()

Returns
String the uri provided for this person or null if no Uri was provided.

isBot

added in API level 28
public boolean isBot ()

Returns
boolean whether this Person is a machine.

isImportant

added in API level 28
public boolean isImportant ()

Returns
boolean whether this Person is important.

toBuilder

added in API level 28
public Person.Builder toBuilder ()

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

Returns
Person.Builder

writeToParcel

added in API level 28
public void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.

Value is either 0 or PARCELABLE_WRITE_RETURN_VALUE.