Sdílet prostřednictvím


DocumentsProvider.OpenAssetFile Method

Definition

Overloads

OpenAssetFile(Uri, String)

Implementation is provided by the parent class.

OpenAssetFile(Uri, String, CancellationSignal)

Implementation is provided by the parent class.

OpenAssetFile(Uri, String)

Implementation is provided by the parent class.

[Android.Runtime.Register("openAssetFile", "(Landroid/net/Uri;Ljava/lang/String;)Landroid/content/res/AssetFileDescriptor;", "")]
public override sealed Android.Content.Res.AssetFileDescriptor? OpenAssetFile (Android.Net.Uri? uri, string? mode);
[<Android.Runtime.Register("openAssetFile", "(Landroid/net/Uri;Ljava/lang/String;)Landroid/content/res/AssetFileDescriptor;", "")>]
override this.OpenAssetFile : Android.Net.Uri * string -> Android.Content.Res.AssetFileDescriptor

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 (erasing whatever data is currently in the file), "wa" for write-only access to append to any existing data, "rw" for read and write access on any existing data, and "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.openAssetFile(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

OpenAssetFile(Uri, String, CancellationSignal)

Implementation is provided by the parent class.

[Android.Runtime.Register("openAssetFile", "(Landroid/net/Uri;Ljava/lang/String;Landroid/os/CancellationSignal;)Landroid/content/res/AssetFileDescriptor;", "")]
public override sealed Android.Content.Res.AssetFileDescriptor? OpenAssetFile (Android.Net.Uri? uri, string? mode, Android.OS.CancellationSignal? signal);
[<Android.Runtime.Register("openAssetFile", "(Landroid/net/Uri;Ljava/lang/String;Landroid/os/CancellationSignal;)Landroid/content/res/AssetFileDescriptor;", "")>]
override this.OpenAssetFile : Android.Net.Uri * string * Android.OS.CancellationSignal -> Android.Content.Res.AssetFileDescriptor

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 (erasing whatever data is currently in the file), "wa" for write-only access to append to any existing data, "rw" for read and write access on any existing data, and "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.openAssetFile(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