Share via


DocumentsProvider.CreateDocument(String, String, String) Method

Definition

Create a new document and return its newly generated Document#COLUMN_DOCUMENT_ID.

[Android.Runtime.Register("createDocument", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "GetCreateDocument_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Handler")]
public virtual string? CreateDocument (string? parentDocumentId, string? mimeType, string? displayName);
[<Android.Runtime.Register("createDocument", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "GetCreateDocument_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Handler")>]
abstract member CreateDocument : string * string * string -> string
override this.CreateDocument : string * string * string -> string

Parameters

parentDocumentId
String

the parent directory to create the new document under.

mimeType
String

the concrete MIME type associated with the new document. If the MIME type is not supported, the provider must throw.

displayName
String

the display name of the new document. The provider may alter this name to meet any internal constraints, such as avoiding conflicting names.

Returns

Attributes

Exceptions

Remarks

Create a new document and return its newly generated Document#COLUMN_DOCUMENT_ID. You must allocate a new Document#COLUMN_DOCUMENT_ID to represent the document, which must not change once returned.

Java documentation for android.provider.DocumentsProvider.createDocument(java.lang.String, 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