Share via


CloudMediaProvider.OnQueryMediaInMediaSet Method

Definition

Queries for the available media items under a given mediaSetId, filtered by extras.

[Android.Runtime.Register("onQueryMediaInMediaSet", "(Ljava/lang/String;Landroid/os/Bundle;Landroid/os/CancellationSignal;)Landroid/database/Cursor;", "GetOnQueryMediaInMediaSet_Ljava_lang_String_Landroid_os_Bundle_Landroid_os_CancellationSignal_Handler", ApiSince=36)]
public virtual Android.Database.ICursor OnQueryMediaInMediaSet(string mediaSetId, Android.OS.Bundle extras, Android.OS.CancellationSignal? cancellationSignal);
[<Android.Runtime.Register("onQueryMediaInMediaSet", "(Ljava/lang/String;Landroid/os/Bundle;Landroid/os/CancellationSignal;)Landroid/database/Cursor;", "GetOnQueryMediaInMediaSet_Ljava_lang_String_Landroid_os_Bundle_Landroid_os_CancellationSignal_Handler", ApiSince=36)>]
abstract member OnQueryMediaInMediaSet : string * Android.OS.Bundle * Android.OS.CancellationSignal -> Android.Database.ICursor
override this.OnQueryMediaInMediaSet : string * Android.OS.Bundle * Android.OS.CancellationSignal -> Android.Database.ICursor

Parameters

mediaSetId
String

the ID of the media set to filter media items.

extras
Bundle

containing keys to filter media items: <ul> <li> CloudMediaProviderContract#EXTRA_PAGE_TOKEN<li> CloudMediaProviderContract#EXTRA_PAGE_SIZE<li> CloudMediaProviderContract#EXTRA_SORT_ORDER<li> android.content.Intent#EXTRA_MIME_TYPES</ul>

cancellationSignal
CancellationSignal

CancellationSignal to check if request has been cancelled.

Returns

cursor representing CloudMediaProviderContract.MediaColumns columns

Attributes

Remarks

Queries for the available media items under a given mediaSetId, filtered by extras. The columns of Media are in the class CloudMediaProviderContract.MediaColumns. mediaSetId is the ID given as part of CloudMediaProviderContract.MediaSetColumns#ID

The order in which media items are sorted in the cursor will be retained when displaying results to the user.

The cloud media provider must set the CloudMediaProviderContract#EXTRA_MEDIA_COLLECTION_ID as part of the returned Cursor by using Cursor#setExtras. Not setting this is an error and invalidates the returned Cursor, meaning photo picker will not use the cursor for any operation.

extras may contain some key-value pairs which should be used to prepare the results. If the provider handled any filters in extras, it must add the key to the ContentResolver#EXTRA_HONORED_ARGS as part of the returned cursor by using Cursor#setExtras. If not honored, photo picker will assume the result of the query is without the extra being used.

If the cloud media provider supports pagination, they can set CloudMediaProviderContract#EXTRA_PAGE_TOKEN as the next page token, as part of the returned cursor by using Cursor#setExtras. If a token is set, the OS will pass it as a key-value pair in extras when querying for media for subsequent pages. The provider can keep returning pagination tokens in the returned cursor by using Cursor#setExtras until the last page at which point it should not set a token in the returned cursor.

Java documentation for android.provider.CloudMediaProvider.onQueryMediaInMediaSet(java.lang.String, android.os.Bundle, android.os.CancellationSignal).

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