Udostępnij za pośrednictwem


ContentResolver.NotifyChange Method

Definition

Overloads

NotifyChange(Uri, ContentObserver)

Notify registered observers that a row was updated and attempt to sync changes to the network.

NotifyChange(Uri, ContentObserver, NotifyChangeFlags)

Notify registered observers that a row was updated.

NotifyChange(Uri, ContentObserver, Boolean)

Notify registered observers that a row was updated.

NotifyChange(ICollection<Uri>, ContentObserver, NotifyChangeFlags)

Notify registered observers that several rows have been updated.

NotifyChange(Uri, ContentObserver)

Notify registered observers that a row was updated and attempt to sync changes to the network.

[Android.Runtime.Register("notifyChange", "(Landroid/net/Uri;Landroid/database/ContentObserver;)V", "GetNotifyChange_Landroid_net_Uri_Landroid_database_ContentObserver_Handler")]
public virtual void NotifyChange (Android.Net.Uri uri, Android.Database.ContentObserver? observer);
[<Android.Runtime.Register("notifyChange", "(Landroid/net/Uri;Landroid/database/ContentObserver;)V", "GetNotifyChange_Landroid_net_Uri_Landroid_database_ContentObserver_Handler")>]
abstract member NotifyChange : Android.Net.Uri * Android.Database.ContentObserver -> unit
override this.NotifyChange : Android.Net.Uri * Android.Database.ContentObserver -> unit

Parameters

uri
Uri

The uri of the content that was changed.

observer
ContentObserver

The observer that originated the change, may be null. The observer that originated the change will only receive the notification if it has requested to receive self-change notifications by implementing ContentObserver#deliverSelfNotifications() to return true.

Attributes

Remarks

Notify registered observers that a row was updated and attempt to sync changes to the network.

To observe events sent through this call, use #registerContentObserver(Uri, boolean, ContentObserver).

Starting in android.os.Build.VERSION_CODES#O, all content notifications must be backed by a valid ContentProvider.

Java documentation for android.content.ContentResolver.notifyChange(android.net.Uri, android.database.ContentObserver).

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

NotifyChange(Uri, ContentObserver, NotifyChangeFlags)

Notify registered observers that a row was updated.

[Android.Runtime.Register("notifyChange", "(Landroid/net/Uri;Landroid/database/ContentObserver;I)V", "GetNotifyChange_Landroid_net_Uri_Landroid_database_ContentObserver_IHandler", ApiSince=24)]
public virtual void NotifyChange (Android.Net.Uri uri, Android.Database.ContentObserver? observer, Android.Content.NotifyChangeFlags flags);
[<Android.Runtime.Register("notifyChange", "(Landroid/net/Uri;Landroid/database/ContentObserver;I)V", "GetNotifyChange_Landroid_net_Uri_Landroid_database_ContentObserver_IHandler", ApiSince=24)>]
abstract member NotifyChange : Android.Net.Uri * Android.Database.ContentObserver * Android.Content.NotifyChangeFlags -> unit
override this.NotifyChange : Android.Net.Uri * Android.Database.ContentObserver * Android.Content.NotifyChangeFlags -> unit

Parameters

uri
Uri

The uri of the content that was changed.

observer
ContentObserver

The observer that originated the change, may be null. The observer that originated the change will only receive the notification if it has requested to receive self-change notifications by implementing ContentObserver#deliverSelfNotifications() to return true.

flags
NotifyChangeFlags

Additional flags: #NOTIFY_SYNC_TO_NETWORK.

Attributes

Remarks

Notify registered observers that a row was updated.

To observe events sent through this call, use #registerContentObserver(Uri, boolean, ContentObserver).

If #NOTIFY_SYNC_TO_NETWORK is set, this will attempt to schedule a local sync using the sync adapter that's registered for the authority of the provided uri. No account will be passed to the sync adapter, so all matching accounts will be synchronized.

Starting in android.os.Build.VERSION_CODES#O, all content notifications must be backed by a valid ContentProvider.

Java documentation for android.content.ContentResolver.notifyChange(android.net.Uri, android.database.ContentObserver, int).

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

NotifyChange(Uri, ContentObserver, Boolean)

Notify registered observers that a row was updated.

[Android.Runtime.Register("notifyChange", "(Landroid/net/Uri;Landroid/database/ContentObserver;Z)V", "GetNotifyChange_Landroid_net_Uri_Landroid_database_ContentObserver_ZHandler")]
public virtual void NotifyChange (Android.Net.Uri uri, Android.Database.ContentObserver? observer, bool syncToNetwork);
[<Android.Runtime.Register("notifyChange", "(Landroid/net/Uri;Landroid/database/ContentObserver;Z)V", "GetNotifyChange_Landroid_net_Uri_Landroid_database_ContentObserver_ZHandler")>]
abstract member NotifyChange : Android.Net.Uri * Android.Database.ContentObserver * bool -> unit
override this.NotifyChange : Android.Net.Uri * Android.Database.ContentObserver * bool -> unit

Parameters

uri
Uri

The uri of the content that was changed.

observer
ContentObserver

The observer that originated the change, may be null. The observer that originated the change will only receive the notification if it has requested to receive self-change notifications by implementing ContentObserver#deliverSelfNotifications() to return true.

syncToNetwork
Boolean

If true, same as #NOTIFY_SYNC_TO_NETWORK.

Attributes

Remarks

Notify registered observers that a row was updated.

To observe events sent through this call, use #registerContentObserver(Uri, boolean, ContentObserver).

If syncToNetwork is true, this will attempt to schedule a local sync using the sync adapter that's registered for the authority of the provided uri. No account will be passed to the sync adapter, so all matching accounts will be synchronized.

Starting in android.os.Build.VERSION_CODES#O, all content notifications must be backed by a valid ContentProvider.

This member is deprecated. callers should consider migrating to #notifyChange(Uri, ContentObserver, int), as it offers support for many more options than just #NOTIFY_SYNC_TO_NETWORK.

Java documentation for android.content.ContentResolver.notifyChange(android.net.Uri, android.database.ContentObserver, boolean).

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.

See also

  • <xref:Android.Content.ContentResolver.RequestSync(Android.Accounts.Account%2c+System.String%2c+System.String)>

Applies to

NotifyChange(ICollection<Uri>, ContentObserver, NotifyChangeFlags)

Notify registered observers that several rows have been updated.

[Android.Runtime.Register("notifyChange", "(Ljava/util/Collection;Landroid/database/ContentObserver;I)V", "GetNotifyChange_Ljava_util_Collection_Landroid_database_ContentObserver_IHandler", ApiSince=30)]
public virtual void NotifyChange (System.Collections.Generic.ICollection<Android.Net.Uri> uris, Android.Database.ContentObserver? observer, Android.Content.NotifyChangeFlags flags);
[<Android.Runtime.Register("notifyChange", "(Ljava/util/Collection;Landroid/database/ContentObserver;I)V", "GetNotifyChange_Ljava_util_Collection_Landroid_database_ContentObserver_IHandler", ApiSince=30)>]
abstract member NotifyChange : System.Collections.Generic.ICollection<Android.Net.Uri> * Android.Database.ContentObserver * Android.Content.NotifyChangeFlags -> unit
override this.NotifyChange : System.Collections.Generic.ICollection<Android.Net.Uri> * Android.Database.ContentObserver * Android.Content.NotifyChangeFlags -> unit

Parameters

uris
ICollection<Uri>

The uris of the content that was changed.

observer
ContentObserver

The observer that originated the change, may be null. The observer that originated the change will only receive the notification if it has requested to receive self-change notifications by implementing ContentObserver#deliverSelfNotifications() to return true.

flags
NotifyChangeFlags

Flags such as #NOTIFY_SYNC_TO_NETWORK or #NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS.

Attributes

Remarks

Notify registered observers that several rows have been updated.

To observe events sent through this call, use #registerContentObserver(Uri, boolean, ContentObserver).

If #NOTIFY_SYNC_TO_NETWORK is set, this will attempt to schedule a local sync using the sync adapter that's registered for the authority of the provided uri. No account will be passed to the sync adapter, so all matching accounts will be synchronized.

Starting in android.os.Build.VERSION_CODES#O, all content notifications must be backed by a valid ContentProvider.

Java documentation for android.content.ContentResolver.notifyChange(java.util.Collection<android.net.Uri>, android.database.ContentObserver, int).

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