Android.Provider.DocumentsProvider.OpenDocument Method
Open and return the requested document.

Syntax

[Android.Runtime.Register("openDocument", "(Ljava/lang/String;Ljava/lang/String;Landroid/os/CancellationSignal;)Landroid/os/ParcelFileDescriptor;", "GetOpenDocument_Ljava_lang_String_Ljava_lang_String_Landroid_os_CancellationSignal_Handler")]
public abstract Android.OS.ParcelFileDescriptor OpenDocument (string documentId, string mode, Android.OS.CancellationSignal signal)

See Also

Android.OS.ParcelFileDescriptor.Open(Java.IO.File, Android.OS.ParcelFileMode, Android.OS.ParcelFileMode, Android.OS.ParcelFileMode)
Android.OS.ParcelFileDescriptor.CreateReliablePipe
Android.OS.ParcelFileDescriptor.CreateReliableSocketPair
Android.OS.ParcelFileDescriptor.ParseMode(string)

Parameters

documentId
the document to return.
mode
the mode to open with, such as 'r', 'w', or 'rw'.
signal
used by the caller to signal if the request should be cancelled. May be null.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.IO.FileNotFoundException

Remarks

Open and return the requested document.

Your provider should return a reliable Android.OS.ParcelFileDescriptor to detect when the remote caller has finished reading or writing the document. You may return a pipe or socket pair if the mode is exclusively "r" or "w", but complex modes like "rw" imply a normal file on disk that supports seeking.

If you block while downloading content, you should periodically check Android.OS.CancellationSignal.IsCanceled to abort abandoned open requests.

[Android Documentation]

Requirements

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