共用方式為


ContentResolver.AddStatusChangeListener Method

Definition

Request notifications when the different aspects of the SyncManager change.

[Android.Runtime.Register("addStatusChangeListener", "(ILandroid/content/SyncStatusObserver;)Ljava/lang/Object;", "")]
public static Java.Lang.Object? AddStatusChangeListener (Android.Content.SyncObserverType mask, Android.Content.ISyncStatusObserver? callback);
[<Android.Runtime.Register("addStatusChangeListener", "(ILandroid/content/SyncStatusObserver;)Ljava/lang/Object;", "")>]
static member AddStatusChangeListener : Android.Content.SyncObserverType * Android.Content.ISyncStatusObserver -> Java.Lang.Object

Parameters

mask
SyncObserverType

the status change types that will cause the callback to be invoked

callback
ISyncStatusObserver

observer to be invoked when the status changes

Returns

a handle that can be used to remove the listener at a later time

Attributes

Remarks

Request notifications when the different aspects of the SyncManager change. The different items that can be requested are: <ul> <li> #SYNC_OBSERVER_TYPE_PENDING<li> #SYNC_OBSERVER_TYPE_ACTIVE<li> #SYNC_OBSERVER_TYPE_SETTINGS</ul> The caller can set one or more of the status types in the mask for any given listener registration.

Java documentation for android.content.ContentResolver.addStatusChangeListener(int, android.content.SyncStatusObserver).

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.

Applies to