Sdílet prostřednictvím


ContentResolver.Update Method

Definition

Overloads

Update(Uri, ContentValues, Bundle)

Update row(s) in a content URI.

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

Update row(s) in a content URI.

Update(Uri, ContentValues, Bundle)

Update row(s) in a content URI.

[Android.Runtime.Register("update", "(Landroid/net/Uri;Landroid/content/ContentValues;Landroid/os/Bundle;)I", "", ApiSince=30)]
public 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", "", ApiSince=30)>]
member this.Update : Android.Net.Uri * Android.Content.ContentValues * Android.OS.Bundle -> int

Parameters

uri
Uri

The URI to modify.

values
ContentValues

The new field values. The key is the column name for the field. A null value will remove an existing field value.

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 updated.

Attributes

Remarks

Update row(s) in a content URI.

If the content provider supports transactions the update will be atomic.

Java documentation for android.content.ContentResolver.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

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

Update row(s) in a content URI.

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

Parameters

uri
Uri

The URI to modify.

values
ContentValues

The new field values. The key is the column name for the field. A null value will remove an existing field value.

where
String

A filter to apply to rows before updating, formatted as an SQL WHERE clause (excluding the WHERE itself).

selectionArgs
String[]

Returns

the number of rows updated.

Attributes

Exceptions

if uri or values are null

Remarks

Update row(s) in a content URI.

If the content provider supports transactions the update will be atomic.

Java documentation for android.content.ContentResolver.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