java.lang.Object | |
↳ | android.provider.DocumentsContract |
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.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
DocumentsContract.Document |
Constants related to a document, including
Cursor
column names
and flags.
|
|||||||||
|
DocumentsContract.Root |
Constants related to a root of documents, including
Cursor
column
names and flags.
|
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | EXTRA_ERROR |
Optional string included in a directory
getExtras()
providing an error message that should be shown to a user.
|
|||||||||
String | EXTRA_INFO |
Optional string included in a directory
getExtras()
providing an informational message that should be shown to a user.
|
|||||||||
String | EXTRA_LOADING |
Optional boolean flag included in a directory
getExtras()
indicating that a document provider is still loading data.
|
|||||||||
String | PROVIDER_INTERFACE |
Intent action used to identify
DocumentsProvider
instances.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Build URI representing the children of the given directory in a document
provider.
|
||||||||||
|
Build URI representing the given
COLUMN_DOCUMENT_ID
in a
document provider.
|
||||||||||
|
Build URI representing the recently modified documents of a specific root
in a document provider.
|
||||||||||
|
Build URI representing the given
COLUMN_ROOT_ID
in a
document provider.
|
||||||||||
|
Build URI representing the roots of a document provider.
|
||||||||||
|
Build URI representing a search for matching documents under a specific
root in a document provider.
|
||||||||||
|
Delete the given document.
|
||||||||||
|
Extract the
COLUMN_DOCUMENT_ID
from the given URI.
|
||||||||||
|
Return thumbnail representing the document at the given URI.
|
||||||||||
|
Extract the
COLUMN_ROOT_ID
from the given URI.
|
||||||||||
|
Extract the search query from a URI built by
buildSearchDocumentsUri(String, String, String)
.
|
||||||||||
|
Test if the given URI represents a
DocumentsContract.Document
backed by a
DocumentsProvider
.
|
[Expand]
Inherited Methods
|
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Optional string included in a directory
getExtras()
providing an error message that should be shown to a user. For example, a
provider may wish to indicate that a network error occurred. The user may
choose to retry, resulting in a new query.
Optional string included in a directory
getExtras()
providing an informational message that should be shown to a user. For
example, a provider may wish to indicate that not all documents are
available.
Optional boolean flag included in a directory
getExtras()
indicating that a document provider is still loading data. For example, a
provider has returned some results, but is still waiting on an
outstanding network request. The provider must send a content changed
notification when loading is finished.
Intent action used to identify
DocumentsProvider
instances. This
is used in the
of a
.
Build URI representing the children of the given directory in a document
provider. When queried, a provider will return zero or more rows with
columns defined by
DocumentsContract.Document
.
parentDocumentId |
the document to return children for, which must
be a directory with MIME type of
MIME_TYPE_DIR
.
|
---|
Build URI representing the given
COLUMN_DOCUMENT_ID
in a
document provider. When queried, a provider will return a single row with
columns defined by
DocumentsContract.Document
.
Build URI representing the recently modified documents of a specific root
in a document provider. When queried, a provider will return zero or more
rows with columns defined by
DocumentsContract.Document
.
Build URI representing the given
COLUMN_ROOT_ID
in a
document provider.
Build URI representing the roots of a document provider. When queried, a
provider will return one or more rows with columns defined by
DocumentsContract.Root
.
Build URI representing a search for matching documents under a specific
root in a document provider. When queried, a provider will return zero or
more rows with columns defined by
DocumentsContract.Document
.
Delete the given document.
documentUri |
document with
FLAG_SUPPORTS_DELETE
|
---|
Extract the
COLUMN_DOCUMENT_ID
from the given URI.
Return thumbnail representing the document at the given URI. Callers are responsible for their own in-memory caching.
documentUri |
document to return thumbnail for, which must have
FLAG_SUPPORTS_THUMBNAIL
set.
|
---|---|
size | optimal thumbnail size desired. A provider may return a thumbnail of a different size, but never more than double the requested size. |
signal | signal used to indicate if caller is no longer interested in the thumbnail. |
null
if problem was encountered.
Extract the
COLUMN_ROOT_ID
from the given URI.
Extract the search query from a URI built by
buildSearchDocumentsUri(String, String, String)
.
Test if the given URI represents a
DocumentsContract.Document
backed by a
DocumentsProvider
.