Share via


CloudMediaProvider.OnOpenMedia(String, Bundle, CancellationSignal) Method

Definition

Returns the full size media item identified by mediaId.

[Android.Runtime.Register("onOpenMedia", "(Ljava/lang/String;Landroid/os/Bundle;Landroid/os/CancellationSignal;)Landroid/os/ParcelFileDescriptor;", "GetOnOpenMedia_Ljava_lang_String_Landroid_os_Bundle_Landroid_os_CancellationSignal_Handler", ApiSince=33)]
public abstract Android.OS.ParcelFileDescriptor OnOpenMedia (string mediaId, Android.OS.Bundle? extras, Android.OS.CancellationSignal? signal);
[<Android.Runtime.Register("onOpenMedia", "(Ljava/lang/String;Landroid/os/Bundle;Landroid/os/CancellationSignal;)Landroid/os/ParcelFileDescriptor;", "GetOnOpenMedia_Ljava_lang_String_Landroid_os_Bundle_Landroid_os_CancellationSignal_Handler", ApiSince=33)>]
abstract member OnOpenMedia : string * Android.OS.Bundle * Android.OS.CancellationSignal -> Android.OS.ParcelFileDescriptor

Parameters

mediaId
String

the media item to return

extras
Bundle

to modify the way the fd is opened, there's none at the moment, but some might be implemented in the future

signal
CancellationSignal

used by the OS to signal if the request should be cancelled

Returns

read-only file descriptor for accessing the media file

Attributes

Remarks

Returns the full size media item identified by mediaId.

If you block while downloading content, you should periodically check CancellationSignal#isCanceled() to abort abandoned open requests.

Java documentation for android.provider.CloudMediaProvider.onOpenMedia(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