public
static
class
ContactsContract.StatusUpdates
extends Object
implements
ContactsContract.StatusColumns,
ContactsContract.PresenceColumns
java.lang.Object | |
↳ | android.provider.ContactsContract.StatusUpdates |
A status update is linked to a ContactsContract.Data
row and captures
the user's latest status update via the corresponding source, e.g.
"Having lunch" via "Google Talk".
There are two ways a status update can be inserted: by explicitly linking
it to a Data row using ContactsContract.PresenceColumns.DATA_ID
or indirectly linking it to a data row
using a combination of ContactsContract.PresenceColumns.PROTOCOL
(or ContactsContract.PresenceColumns.CUSTOM_PROTOCOL
) and
ContactsContract.PresenceColumns.IM_HANDLE
. There is no difference between insert and update, you can use
either.
Inserting or updating a status update for the user's profile requires either using
the ContactsContract.PresenceColumns.DATA_ID
to identify the data row to attach the update to, or
StatusUpdates#PROFILE_CONTENT_URI
to ensure that the change is scoped to the
profile.
You cannot use ContentResolver#update
to change a status, but
ContentResolver#insert
will replace the latests status if it already
exists.
Use ContentResolver#bulkInsert(Uri, ContentValues[])
to insert/update statuses
for multiple contacts at once.
Constants | |
---|---|
String |
CONTENT_ITEM_TYPE
The MIME type of a |
String |
CONTENT_TYPE
The MIME type of |
Inherited constants |
---|
Fields | |
---|---|
public
static
final
Uri |
CONTENT_URI
The content:// style URI for this table |
public
static
final
Uri |
PROFILE_CONTENT_URI
The content:// style URI for this table, specific to the user's profile. |
Public methods | |
---|---|
static
final
int
|
getPresenceIconResourceId(int status)
Gets the resource ID for the proper presence icon. |
static
final
int
|
getPresencePrecedence(int status)
Returns the precedence of the status code the higher number being the higher precedence. |
Inherited methods | |
---|---|
public static final String CONTENT_ITEM_TYPE
The MIME type of a CONTENT_URI
subdirectory of a single
status update detail.
Constant Value: "vnd.android.cursor.item/status-update"
public static final String CONTENT_TYPE
The MIME type of CONTENT_URI
providing a directory of
status update details.
Constant Value: "vnd.android.cursor.dir/status-update"
public static final Uri PROFILE_CONTENT_URI
The content:// style URI for this table, specific to the user's profile.
public static final int getPresenceIconResourceId (int status)
Gets the resource ID for the proper presence icon.
Parameters | |
---|---|
status |
int : the status to get the icon for |
Returns | |
---|---|
int |
the resource ID for the proper presence icon |
public static final int getPresencePrecedence (int status)
Returns the precedence of the status code the higher number being the higher precedence.
Parameters | |
---|---|
status |
int : The status code. |
Returns | |
---|---|
int |
An integer representing the precedence, 0 being the lowest. |