Share via


DocumentsProvider.QueryChildDocuments Method

Definition

Overloads

QueryChildDocuments(String, String[], Bundle)

Override this method to return the children documents contained in the requested directory.

QueryChildDocuments(String, String[], String)

Return the children documents contained in the requested directory.

QueryChildDocuments(String, String[], Bundle)

Override this method to return the children documents contained in the requested directory.

[Android.Runtime.Register("queryChildDocuments", "(Ljava/lang/String;[Ljava/lang/String;Landroid/os/Bundle;)Landroid/database/Cursor;", "GetQueryChildDocuments_Ljava_lang_String_arrayLjava_lang_String_Landroid_os_Bundle_Handler", ApiSince=26)]
public virtual Android.Database.ICursor? QueryChildDocuments (string? parentDocumentId, string[]? projection, Android.OS.Bundle? queryArgs);
[<Android.Runtime.Register("queryChildDocuments", "(Ljava/lang/String;[Ljava/lang/String;Landroid/os/Bundle;)Landroid/database/Cursor;", "GetQueryChildDocuments_Ljava_lang_String_arrayLjava_lang_String_Landroid_os_Bundle_Handler", ApiSince=26)>]
abstract member QueryChildDocuments : string * string[] * Android.OS.Bundle -> Android.Database.ICursor
override this.QueryChildDocuments : string * string[] * Android.OS.Bundle -> Android.Database.ICursor

Parameters

parentDocumentId
String

the directory to return children for.

projection
String[]

list of Document columns to put into the cursor. If null all supported columns should be included.

queryArgs
Bundle

Bundle containing sorting information or other argument useful to the provider. If no sorting information is available, default sorting will be used, which may be unordered. See ContentResolver#QUERY_ARG_SORT_COLUMNS for details.

Returns

Attributes

Remarks

Override this method to return the children documents contained in the requested directory. This must return immediate descendants only.

If your provider is cloud-based, and you have data cached locally, you may return the local data immediately, setting DocumentsContract#EXTRA_LOADING on Cursor extras to indicate that you are still fetching additional data. Then, when the network data is available, you can send a change notification to trigger a requery and return the complete contents. To return a Cursor with extras, you need to extend and override Cursor#getExtras().

To support change notifications, you must Cursor#setNotificationUri(ContentResolver, Uri) with a relevant Uri, such as DocumentsContract#buildChildDocumentsUri(String, String). Then you can call ContentResolver#notifyChange(Uri, android.database.ContentObserver, boolean) with that Uri to send change notifications.

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

QueryChildDocuments(String, String[], String)

Return the children documents contained in the requested directory.

[Android.Runtime.Register("queryChildDocuments", "(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;", "GetQueryChildDocuments_Ljava_lang_String_arrayLjava_lang_String_Ljava_lang_String_Handler")]
public abstract Android.Database.ICursor? QueryChildDocuments (string? parentDocumentId, string[]? projection, string? sortOrder);
[<Android.Runtime.Register("queryChildDocuments", "(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;", "GetQueryChildDocuments_Ljava_lang_String_arrayLjava_lang_String_Ljava_lang_String_Handler")>]
abstract member QueryChildDocuments : string * string[] * string -> Android.Database.ICursor

Parameters

parentDocumentId
String

the directory to return children for.

projection
String[]

list of Document columns to put into the cursor. If null all supported columns should be included.

sortOrder
String

how to order the rows, formatted as an SQL ORDER BY clause (excluding the ORDER BY itself). Passing null will use the default sort order, which may be unordered. This ordering is a hint that can be used to prioritize how data is fetched from the network, but UI may always enforce a specific ordering.

Returns

Attributes

Exceptions

Remarks

Return the children documents contained in the requested directory. This must only return immediate descendants, as additional queries will be issued to recursively explore the tree.

Apps targeting android.os.Build.VERSION_CODES#O or higher should override #queryChildDocuments(String, String[], Bundle).

If your provider is cloud-based, and you have some data cached or pinned locally, you may return the local data immediately, setting DocumentsContract#EXTRA_LOADING on the Cursor to indicate that you are still fetching additional data. Then, when the network data is available, you can send a change notification to trigger a requery and return the complete contents. To return a Cursor with extras, you need to extend and override Cursor#getExtras().

To support change notifications, you must Cursor#setNotificationUri(ContentResolver, Uri) with a relevant Uri, such as DocumentsContract#buildChildDocumentsUri(String, String). Then you can call ContentResolver#notifyChange(Uri, android.database.ContentObserver, boolean) with that Uri to send change notifications.

Java documentation for android.provider.DocumentsProvider.queryChildDocuments(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.

See also

Applies to