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 |
Public methods | |
---|---|
static
Person
|
fromBundle(Bundle bundle)
Extracts and returns the |
IconCompat
|
getIcon()
Returns the icon for this |
String
|
getKey()
Returns the key for this |
CharSequence
|
getName()
Returns the name for this |
String
|
getUri()
Returns the raw URI for this |
boolean
|
isBot()
Returns whether or not this |
boolean
|
isImportant()
Returns whether or not this |
Person.Builder
|
toBuilder()
Creates and returns a new |
Bundle
|
toBundle()
Writes and returns a new |
Inherited methods | |
---|---|
Public methods
fromBundle
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
public IconCompat getIcon ()
Returns the icon for this Person
or null
if no icon was provided.
Returns | |
---|---|
IconCompat |
getKey
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 Person
s.
Returns | |
---|---|
String |
getName
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
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:
- The
String
representation of aContactsContract.Contacts.CONTENT_LOOKUP_URI
- A
mailto:
schema* - A
tel:
schema*
*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
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
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
public Person.Builder toBuilder ()
Creates and returns a new Person.Builder
initialized with this Person's data.
Returns | |
---|---|
Person.Builder |
toBundle
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 |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-09-30 UTC.