CloudMediaProvider.OnQueryMediaSets Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Queries for the available MediaSets under a given mediaCategoryId
,
filtered by extras
.
[Android.Runtime.Register("onQueryMediaSets", "(Ljava/lang/String;Landroid/os/Bundle;Landroid/os/CancellationSignal;)Landroid/database/Cursor;", "GetOnQueryMediaSets_Ljava_lang_String_Landroid_os_Bundle_Landroid_os_CancellationSignal_Handler", ApiSince=36)]
public virtual Android.Database.ICursor OnQueryMediaSets(string mediaCategoryId, Android.OS.Bundle extras, Android.OS.CancellationSignal? cancellationSignal);
[<Android.Runtime.Register("onQueryMediaSets", "(Ljava/lang/String;Landroid/os/Bundle;Landroid/os/CancellationSignal;)Landroid/database/Cursor;", "GetOnQueryMediaSets_Ljava_lang_String_Landroid_os_Bundle_Landroid_os_CancellationSignal_Handler", ApiSince=36)>]
abstract member OnQueryMediaSets : string * Android.OS.Bundle * Android.OS.CancellationSignal -> Android.Database.ICursor
override this.OnQueryMediaSets : string * Android.OS.Bundle * Android.OS.CancellationSignal -> Android.Database.ICursor
Parameters
- mediaCategoryId
- String
the ID of the media category to filter media sets.
- extras
- Bundle
containing keys to filter media sets:
<ul>
<li> CloudMediaProviderContract#EXTRA_PAGE_TOKEN
<li> CloudMediaProviderContract#EXTRA_PAGE_SIZE
<li> android.content.Intent#EXTRA_MIME_TYPES
</ul>
- cancellationSignal
- CancellationSignal
CancellationSignal
to check if request has been cancelled.
Returns
cursor representing CloudMediaProviderContract.MediaSetColumns
columns
- Attributes
Remarks
Queries for the available MediaSets under a given mediaCategoryId
, filtered by extras
. The columns of MediaSet are in the class CloudMediaProviderContract.MediaSetColumns
.
This returns MediaSets directly inside the given MediaCategoryId. If the passed mediaCategoryId has some more nested mediaCategories, the mediaSets inside the nested mediaCategories must not be returned in this response.
The order in which media sets 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 query media sets 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.
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.