Android.Provider.DocumentsProvider.QuerySearchDocuments Method
Return documents that that match the given query under the requested root.

Syntax

[Android.Runtime.Register("querySearchDocuments", "(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;", "GetQuerySearchDocuments_Ljava_lang_String_Ljava_lang_String_arrayLjava_lang_String_Handler")]
public virtual Android.Database.ICursor QuerySearchDocuments (string rootId, string query, string[] projection)

See Also

DocumentsContract.ExtraLoading
DocumentsContract.ExtraInfo
DocumentsContract.ExtraError

Parameters

rootId
the root to search under.
query
string to match documents against.
projection
list of NoType:android/provider/DocumentsContract$Document;Href=../../../reference/android/provider/DocumentsContract.Document.html columns to put into the cursor. If null all supported columns should be included.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.IO.FileNotFoundException

Remarks

Return documents that that match the given query under the requested root. The returned documents should be sorted by relevance in descending order. How documents are matched against the query string is an implementation detail left to each provider, but it's suggested that at least NoType:android/provider/DocumentsContract$Document;Href=../../../reference/android/provider/DocumentsContract.Document.html#COLUMN_DISPLAY_NAME be matched in a case-insensitive fashion.

Only documents may be returned; directories are not supported in search results.

If your provider is cloud-based, and you have some data cached or pinned locally, you may return the local data immediately, setting DocumentsContract.ExtraLoading 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 support change notifications, you must Android.Database.ICursor.SetNotificationUri(Android.Content.ContentResolver, Android.Net.Uri) with a relevant Uri, such as DocumentsContract.BuildSearchDocumentsUri(string, System.String, System.String). Then you can call Android.Content.ContentResolver.NotifyChange(Android.Net.Uri, Android.Database.ContentObserver, Android.Database.ContentObserver) with that Uri to send change notifications.

[Android Documentation]

Requirements

Namespace: Android.Provider
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0