Partager via


DocumentsProvider.OpenFile Method

Definition

Overloads

OpenFile(Uri, String)

Implementation is provided by the parent class.

OpenFile(Uri, String, CancellationSignal)

Implementation is provided by the parent class.

OpenFile(Uri, String)

Implementation is provided by the parent class.

[Android.Runtime.Register("openFile", "(Landroid/net/Uri;Ljava/lang/String;)Landroid/os/ParcelFileDescriptor;", "")]
public override sealed Android.OS.ParcelFileDescriptor? OpenFile (Android.Net.Uri? uri, string? mode);
[<Android.Runtime.Register("openFile", "(Landroid/net/Uri;Ljava/lang/String;)Landroid/os/ParcelFileDescriptor;", "")>]
override this.OpenFile : Android.Net.Uri * string -> Android.OS.ParcelFileDescriptor

Parameters

uri
Uri

The URI whose file is to be opened.

mode
String

Access mode for the file. May be "r" for read-only access, "rw" for read and write access, or "rwt" for read and write access that truncates any existing file.

Returns

Attributes

Exceptions

Remarks

Implementation is provided by the parent class. Cannot be overridden.

Java documentation for android.provider.DocumentsProvider.openFile(android.net.Uri, java.lang.String).

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.

See also

  • <xref:Android.Provider.DocumentsProvider.OpenDocument(System.String%2c+System.String%2c+System.String)>

Applies to

OpenFile(Uri, String, CancellationSignal)

Implementation is provided by the parent class.

[Android.Runtime.Register("openFile", "(Landroid/net/Uri;Ljava/lang/String;Landroid/os/CancellationSignal;)Landroid/os/ParcelFileDescriptor;", "")]
public override sealed Android.OS.ParcelFileDescriptor? OpenFile (Android.Net.Uri? uri, string? mode, Android.OS.CancellationSignal? signal);
[<Android.Runtime.Register("openFile", "(Landroid/net/Uri;Ljava/lang/String;Landroid/os/CancellationSignal;)Landroid/os/ParcelFileDescriptor;", "")>]
override this.OpenFile : Android.Net.Uri * string * Android.OS.CancellationSignal -> Android.OS.ParcelFileDescriptor

Parameters

uri
Uri

The URI whose file is to be opened.

mode
String

Access mode for the file. May be "r" for read-only access, "w" for write-only access, "rw" for read and write access, or "rwt" for read and write access that truncates any existing file.

signal
CancellationSignal

A signal to cancel the operation in progress, or null if none. For example, if you are downloading a file from the network to service a "rw" mode request, you should periodically call ThrowIfCanceled() to check whether the client has canceled the request and abort the download.

Returns

Attributes

Exceptions

Remarks

Implementation is provided by the parent class. Cannot be overridden.

Java documentation for android.provider.DocumentsProvider.openFile(android.net.Uri, java.lang.String, 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.

See also

  • <xref:Android.Provider.DocumentsProvider.OpenDocument(System.String%2c+System.String%2c+System.String)>

Applies to