Bagikan melalui


ContentResolver.Insert Method

Definition

Overloads

Insert(Uri, ContentValues)

Inserts a row into a table at the given URL.

Insert(Uri, ContentValues, Bundle)

Inserts a row into a table at the given URL.

Insert(Uri, ContentValues)

Inserts a row into a table at the given URL.

[Android.Runtime.Register("insert", "(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;", "")]
public Android.Net.Uri? Insert (Android.Net.Uri url, Android.Content.ContentValues? values);
[<Android.Runtime.Register("insert", "(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;", "")>]
member this.Insert : Android.Net.Uri * Android.Content.ContentValues -> Android.Net.Uri

Parameters

url
Uri

The URL of the table to insert into.

values
ContentValues

The initial values for the newly inserted row. The key is the column name for the field. Passing an empty ContentValues will create an empty row.

Returns

Uri

the URL of the newly created row. May return null if the underlying content provider returns null, or if it crashes.

Attributes

Remarks

Inserts a row into a table at the given URL.

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

Java documentation for android.content.ContentResolver.insert(android.net.Uri, android.content.ContentValues).

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

Insert(Uri, ContentValues, Bundle)

Inserts a row into a table at the given URL.

[Android.Runtime.Register("insert", "(Landroid/net/Uri;Landroid/content/ContentValues;Landroid/os/Bundle;)Landroid/net/Uri;", "", ApiSince=30)]
public Android.Net.Uri? Insert (Android.Net.Uri url, Android.Content.ContentValues? values, Android.OS.Bundle? extras);
[<Android.Runtime.Register("insert", "(Landroid/net/Uri;Landroid/content/ContentValues;Landroid/os/Bundle;)Landroid/net/Uri;", "", ApiSince=30)>]
member this.Insert : Android.Net.Uri * Android.Content.ContentValues * Android.OS.Bundle -> Android.Net.Uri

Parameters

url
Uri

The URL of the table to insert into.

values
ContentValues

The initial values for the newly inserted row. The key is the column name for the field. Passing an empty ContentValues will create an empty row.

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

Uri

the URL of the newly created row. May return null if the underlying content provider returns null, or if it crashes.

Attributes

Remarks

Inserts a row into a table at the given URL.

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

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