Sdílet prostřednictvím


ContentProvider.Update Method

Definition

Overloads

Update(Uri, ContentValues, String, String[])

Implement this to handle requests to update one or more rows.

Update(Uri, ContentValues, Bundle)

Implement this to handle requests to update one or more rows.

Update(Uri, ContentValues, String, String[])

Implement this to handle requests to update one or more rows.

[Android.Runtime.Register("update", "(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I", "GetUpdate_Landroid_net_Uri_Landroid_content_ContentValues_Ljava_lang_String_arrayLjava_lang_String_Handler")]
public abstract int Update (Android.Net.Uri uri, Android.Content.ContentValues? values, string? selection, string[]? selectionArgs);
[<Android.Runtime.Register("update", "(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I", "GetUpdate_Landroid_net_Uri_Landroid_content_ContentValues_Ljava_lang_String_arrayLjava_lang_String_Handler")>]
abstract member Update : Android.Net.Uri * Android.Content.ContentValues * string * string[] -> int

Parameters

uri
Uri

The URI to query. This can potentially have a record ID if this is an update request for a specific record.

values
ContentValues

A set of column_name/value pairs to update in the database.

selection
String

An optional filter to match rows to update.

selectionArgs
String[]

Returns

the number of rows affected.

Attributes

Remarks

Implement this to handle requests to update one or more rows. The implementation should update all rows matching the selection to set the columns according to the provided values map. As a courtesy, call ContentResolver#notifyChange(android.net.Uri ,android.database.ContentObserver) notifyChange() after updating. This method can be called from multiple threads, as described in Processes and Threads.

Java documentation for android.content.ContentProvider.update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[]).

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

Update(Uri, ContentValues, Bundle)

Implement this to handle requests to update one or more rows.

[Android.Runtime.Register("update", "(Landroid/net/Uri;Landroid/content/ContentValues;Landroid/os/Bundle;)I", "GetUpdate_Landroid_net_Uri_Landroid_content_ContentValues_Landroid_os_Bundle_Handler", ApiSince=30)]
public virtual int Update (Android.Net.Uri uri, Android.Content.ContentValues? values, Android.OS.Bundle? extras);
[<Android.Runtime.Register("update", "(Landroid/net/Uri;Landroid/content/ContentValues;Landroid/os/Bundle;)I", "GetUpdate_Landroid_net_Uri_Landroid_content_ContentValues_Landroid_os_Bundle_Handler", ApiSince=30)>]
abstract member Update : Android.Net.Uri * Android.Content.ContentValues * Android.OS.Bundle -> int
override this.Update : Android.Net.Uri * Android.Content.ContentValues * Android.OS.Bundle -> int

Parameters

uri
Uri

The URI to query. This can potentially have a record ID if this is an update request for a specific record.

values
ContentValues

A set of column_name/value pairs to update in the database.

extras
Bundle

A Bundle containing additional information necessary for the operation. Arguments may include SQL style arguments, such as ContentResolver#QUERY_ARG_SQL_LIMIT, but note that the documentation for each individual provider will indicate which arguments they support.

Returns

the number of rows affected.

Attributes

Remarks

Implement this to handle requests to update one or more rows. The implementation should update all rows matching the selection to set the columns according to the provided values map. As a courtesy, call ContentResolver#notifyChange(android.net.Uri ,android.database.ContentObserver) notifyChange() after updating. This method can be called from multiple threads, as described in Processes and Threads.

Java documentation for android.content.ContentProvider.update(android.net.Uri, android.content.ContentValues, android.os.Bundle).

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