Partager via


DocumentsContract Class

Definition

Defines the contract between a documents provider and the platform.

[Android.Runtime.Register("android/provider/DocumentsContract", DoNotGenerateAcw=true)]
public sealed class DocumentsContract : Java.Lang.Object
[<Android.Runtime.Register("android/provider/DocumentsContract", DoNotGenerateAcw=true)>]
type DocumentsContract = class
    inherit Object
Inheritance
DocumentsContract
Attributes

Remarks

Defines the contract between a documents provider and the platform.

To create a document provider, extend DocumentsProvider, which provides a foundational implementation of this contract.

All client apps must hold a valid URI permission grant to access documents, typically issued when a user makes a selection through Intent#ACTION_OPEN_DOCUMENT, Intent#ACTION_CREATE_DOCUMENT, or Intent#ACTION_OPEN_DOCUMENT_TREE.

Java documentation for android.provider.DocumentsContract.

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.

Fields

ActionDocumentSettings

Action of intent issued by DocumentsUI when user wishes to open/configure/manage a particular document in the provider application.

ExtraError

Optional string included in a directory Cursor#getExtras() providing an error message that should be shown to a user.

ExtraExcludeSelf

Set this in a DocumentsUI intent to cause a package's own roots to be excluded from the roots list.

ExtraInfo

Optional string included in a directory Cursor#getExtras() providing an informational message that should be shown to a user.

ExtraInitialUri

Sets the desired initial location visible to user when file chooser is shown.

ExtraLoading

Optional boolean flag included in a directory Cursor#getExtras() indicating that a document provider is still loading data.

ExtraOrientation

An extra number of degrees that an image should be rotated during the decode process to be presented correctly.

ExtraPrompt

Overrides the default prompt text in DocumentsUI when set in an intent.

MetadataExif

Get Exif information using DocumentsContract#getDocumentMetadata.

MetadataTreeCount

Get total count of all documents currently stored under the given directory tree.

MetadataTreeSize

Get total size of all documents currently stored under the given directory tree.

MetadataTypes

Get string array identifies the type or types of metadata returned using DocumentsContract#getDocumentMetadata.

ProviderInterface

Intent action used to identify DocumentsProvider instances.

QueryArgDisplayName

Key for DocumentsProvider to query display name is matched.

QueryArgExcludeMedia

Key for DocumentsProvider to decide whether the files that have been added to MediaStore should be excluded.

QueryArgFileSizeOver

Key for DocumentsProvider to query the file size in bytes is larger than the value.

QueryArgLastModifiedAfter

Key for DocumentsProvider to query the last modified time is newer than the value.

QueryArgMimeTypes

Key for DocumentsProvider to query mime types is matched.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)

Methods

BuildChildDocumentsUri(String, String)

Build URI representing the children of the target directory in a document provider.

BuildChildDocumentsUriUsingTree(Uri, String)

Build URI representing the children of the target directory in a document provider.

BuildDocumentUri(String, String)

Build URI representing the target Document#COLUMN_DOCUMENT_ID in a document provider.

BuildDocumentUriUsingTree(Uri, String)

Build URI representing the target Document#COLUMN_DOCUMENT_ID in a document provider.

BuildRecentDocumentsUri(String, String)

Build URI representing the recently modified documents of a specific root in a document provider.

BuildRootsUri(String)

Build URI representing the roots of a document provider.

BuildRootUri(String, String)

Build URI representing the given Root#COLUMN_ROOT_ID in a document provider.

BuildSearchDocumentsUri(String, String, String)

Build URI representing a search for matching documents under a specific root in a document provider.

BuildTreeDocumentUri(String, String)

Build URI representing access to descendant documents of the given Document#COLUMN_DOCUMENT_ID.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CopyDocument(ContentResolver, Uri, Uri)

Copies the given document.

CreateDocument(ContentResolver, Uri, String, String)

Create a new document with given MIME type and display name.

CreateWebLinkIntent(ContentResolver, Uri, Bundle)

Creates an intent for obtaining a web link for the specified document.

DeleteDocument(ContentResolver, Uri)

Delete the given document.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
EjectRoot(ContentResolver, Uri)

Ejects the given root.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
FindDocumentPath(ContentResolver, Uri)

Finds the canonical path from the top of the document tree.

GetDocumentId(Uri)

Extract the Document#COLUMN_DOCUMENT_ID from the given URI.

GetDocumentMetadata(ContentResolver, Uri)

Returns metadata associated with the document.

GetDocumentThumbnail(ContentResolver, Uri, Point, CancellationSignal)

Return thumbnail representing the document at the given URI.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetRootId(Uri)

Extract the Root#COLUMN_ROOT_ID from the given URI.

GetSearchDocumentsQuery(Uri)

Extract the search query from a URI built by #buildSearchDocumentsUri(String, String, String).

GetTreeDocumentId(Uri)

Extract the via Document#COLUMN_DOCUMENT_ID from the given URI.

IsChildDocument(ContentResolver, Uri, Uri)

Test if a document is descendant (child, grandchild, etc) from the given parent.

IsDocumentUri(Context, Uri)

Test if the given URI represents a Document backed by a DocumentsProvider.

IsRootsUri(Context, Uri)

Test if the given URI represents all roots of the authority backed by DocumentsProvider.

IsRootUri(Context, Uri)

Test if the given URI represents specific root backed by DocumentsProvider.

IsTreeUri(Uri)

Test if the given URI represents a Document tree.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
MoveDocument(ContentResolver, Uri, Uri, Uri)

Moves the given document under a new parent.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
RemoveDocument(ContentResolver, Uri, Uri)

Removes the given document from a parent directory.

RenameDocument(ContentResolver, Uri, String)

Change the display name of an existing document.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to