Most visited

Recently visited

Added in API level 5

ContactsContract.StatusUpdates

public static class ContactsContract.StatusUpdates
extends Object implements ContactsContract.StatusColumns, ContactsContract.PresenceColumns

java.lang.Object
   ↳ android.provider.ContactsContract.StatusUpdates
Known Direct Subclasses


状态更新链接到 ContactsContract.Data行,并通过相应的来源捕获用户的最新状态更新,例如通过“Google Talk”“吃午饭”。

有两种方式可以插入状态更新:通过使用DATA_ID将其明确链接到数据行,或使用PROTOCOL (或CUSTOM_PROTOCOL )和IM_HANDLE的组合将其间接链接到数据行。 插入和更新没有区别,你可以使用。

插入或更新用户配置文件的状态更新需要使用 DATA_ID来标识要将更新附加到更新的数据行,或者 PROFILE_CONTENT_URI以确保将更改的范围限定为配置文件。

您不能使用 update(Uri, ContentValues, String, String[])来更改状态,但如果它已存在,则 insert(Uri, ContentValues)将替换最新的状态。

使用 bulkInsert(Uri, ContentValues[])插入/更新多个联系人的状态。

Columns

StatusUpdates
long DATA_ID read/write Reference to the _ID entry that owns this presence. If this field is not specified, the provider will attempt to find a data row that matches the PROTOCOL (or CUSTOM_PROTOCOL) and IM_HANDLE columns.
long PROTOCOL read/write See ContactsContract.CommonDataKinds.Im for a list of defined protocol constants.
String CUSTOM_PROTOCOL read/write Name of the custom protocol. Should be supplied along with the PROTOCOL value PROTOCOL_CUSTOM. Should be null or omitted if PROTOCOL value is not PROTOCOL_CUSTOM.
String IM_HANDLE read/write The IM handle the presence item is for. The handle is scoped to PROTOCOL.
String IM_ACCOUNT read/write The IM account for the local user that the presence data came from.
int PRESENCE read/write Contact IM presence status. The allowed values are:

由于存在状态本质上是不稳定的,所以内容提供者可以选择不将该字段存储在长期存储中。

int CHAT_CAPABILITY read/write Contact IM chat compatibility value. The allowed values combinations of the following flags. If None of these flags is set, the device can only do text messaging.

由于联系人的可用性从一个设备移动到另一个设备时,聊天兼容性本质上是不稳定的,所以内容提供商可以选择不将该字段存储在长期存储中。

String STATUS read/write Contact's latest status update, e.g. "having toast for breakfast"
long STATUS_TIMESTAMP read/write The absolute time in milliseconds when the status was entered by the user. If this value is not provided, the provider will follow this logic: if there was no prior status update, the value will be left as null. If there was a prior status update, the provider will default this field to the current time.
String STATUS_RES_PACKAGE read/write The package containing resources for this status: label and icon.
long STATUS_LABEL read/write The resource ID of the label describing the source of contact status, e.g. "Google Talk". This resource is scoped by the STATUS_RES_PACKAGE.
long STATUS_ICON read/write The resource ID of the icon for the source of contact status. This resource is scoped by the STATUS_RES_PACKAGE.

Summary

Constants

String CONTENT_ITEM_TYPE

单个状态更新详细信息的 CONTENT_URI子目录的MIME类型。

String CONTENT_TYPE

MIME类型 CONTENT_URI提供状态更新详细信息的目录。

Inherited constants

From interface android.provider.ContactsContract.StatusColumns
From interface android.provider.ContactsContract.PresenceColumns

Fields

public static final Uri CONTENT_URI

该表格的内容://样式URI

public static final Uri PROFILE_CONTENT_URI

内容://表格的特定于用户个人资料的样式URI。

Public methods

static final int getPresenceIconResourceId(int status)

获取适当状态图标的资源ID。

static final int getPresencePrecedence(int status)

返回状态码的优先级,较高的优先级为较高的优先级。

Inherited methods

From class java.lang.Object

Constants

CONTENT_ITEM_TYPE

Added in API level 5
String CONTENT_ITEM_TYPE

单个状态更新详细信息的 CONTENT_URI子目录的MIME类型。

常量值:“vnd.android.cursor.item / status-update”

CONTENT_TYPE

Added in API level 5
String CONTENT_TYPE

MIME类型 CONTENT_URI提供状态更新详细信息的目录。

常量值:“vnd.android.cursor.dir / status-update”

Fields

CONTENT_URI

Added in API level 5
Uri CONTENT_URI

该表格的内容://样式URI

PROFILE_CONTENT_URI

Added in API level 14
Uri PROFILE_CONTENT_URI

内容://表格的特定于用户个人资料的样式URI。

Public methods

getPresenceIconResourceId

Added in API level 5
int getPresenceIconResourceId (int status)

获取适当状态图标的资源ID。

Parameters
status int: the status to get the icon for
Returns
int the resource ID for the proper presence icon

getPresencePrecedence

Added in API level 5
int getPresencePrecedence (int status)

返回状态码的优先级,较高的优先级为较高的优先级。

Parameters
status int: The status code.
Returns
int An integer representing the precedence, 0 being the lowest.

Hooray!