Compartilhar via


ContactsContract.StatusUpdates Class

Definition

A status update is linked to a ContactsContract.Data row and captures the user's latest status update via the corresponding source, e.

[Android.Runtime.Register("android/provider/ContactsContract$StatusUpdates", DoNotGenerateAcw=true)]
public class ContactsContract.StatusUpdates : Java.Lang.Object
[<Android.Runtime.Register("android/provider/ContactsContract$StatusUpdates", DoNotGenerateAcw=true)>]
type ContactsContract.StatusUpdates = class
    inherit Object
Inheritance
ContactsContract.StatusUpdates
Derived
Attributes

Remarks

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 #DATA_ID or indirectly linking it to a data row using a combination of #PROTOCOL (or #CUSTOM_PROTOCOL) and #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 #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.

<h3>Columns</h3> <table class="jd-sumtable"> <tr> <th colspan='4'>StatusUpdates</th> </tr> <tr> <td>long</td> <td>#DATA_ID</td> <td>read/write</td> <td>Reference to the Data#_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. </td> </tr> <tr> <td>long</td> <td>#PROTOCOL</td> <td>read/write</td> <td>See CommonDataKinds.Im for a list of defined protocol constants.</td> </tr> <tr> <td>String</td> <td>#CUSTOM_PROTOCOL</td> <td>read/write</td> <td>Name of the custom protocol. Should be supplied along with the #PROTOCOL value ContactsContract.CommonDataKinds.Im#PROTOCOL_CUSTOM. Should be null or omitted if #PROTOCOL value is not ContactsContract.CommonDataKinds.Im#PROTOCOL_CUSTOM.</td> </tr> <tr> <td>String</td> <td>#IM_HANDLE</td> <td>read/write</td> <td> The IM handle the presence item is for. The handle is scoped to #PROTOCOL.</td> </tr> <tr> <td>String</td> <td>#IM_ACCOUNT</td> <td>read/write</td> <td>The IM account for the local user that the presence data came from.</td> </tr> <tr> <td>int</td> <td>#PRESENCE</td> <td>read/write</td> <td>Contact IM presence status. The allowed values are:

<ul> <li>#OFFLINE</li> <li>#INVISIBLE</li> <li>#AWAY</li> <li>#IDLE</li> <li>#DO_NOT_DISTURB</li> <li>#AVAILABLE</li> </ul>

Since presence status is inherently volatile, the content provider may choose not to store this field in long-term storage.

</td> </tr> <tr> <td>int</td> <td>#CHAT_CAPABILITY</td> <td>read/write</td> <td>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.

<ul> <li>#CAPABILITY_HAS_VIDEO</li> <li>#CAPABILITY_HAS_VOICE</li> <li>#CAPABILITY_HAS_CAMERA</li> </ul>

Since chat compatibility is inherently volatile as the contact's availability moves from one device to another, the content provider may choose not to store this field in long-term storage.

</td> </tr> <tr> <td>String</td> <td>#STATUS</td> <td>read/write</td> <td>Contact's latest status update, e.g. "having toast for breakfast"</td> </tr> <tr> <td>long</td> <td>#STATUS_TIMESTAMP</td> <td>read/write</td> <td>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.</td> </tr> <tr> <td>String</td> <td>#STATUS_RES_PACKAGE</td> <td>read/write</td> <td> The package containing resources for this status: label and icon.</td> </tr> <tr> <td>long</td> <td>#STATUS_LABEL</td> <td>read/write</td> <td>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.</td> </tr> <tr> <td>long</td> <td>#STATUS_ICON</td> <td>read/write</td> <td>The resource ID of the icon for the source of contact status. This resource is scoped by the #STATUS_RES_PACKAGE.</td> </tr> </table>

Java documentation for android.provider.ContactsContract.StatusUpdates.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

ContactsContract.StatusUpdates(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

ContentItemType

The MIME type of a #CONTENT_URI subdirectory of a single status update detail.

ContentType

The MIME type of #CONTENT_URI providing a directory of status update details.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
ContentUri

The content:// style URI for this table

Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ProfileContentUri

The content:// style URI for this table, specific to the user's profile.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetPresenceIconResourceId(StatusPresence)

Gets the resource ID for the proper presence icon.

GetPresencePrecedence(StatusPresence)

Returns the precedence of the status code the higher number being the higher precedence.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to