IAssetsProvider.LoadAssetFd(String, Int32) Method

Definition

Callback that allows the value of a file-based resources or asset to be specified or overridden.

[Android.Runtime.Register("loadAssetFd", "(Ljava/lang/String;I)Landroid/content/res/AssetFileDescriptor;", "GetLoadAssetFd_Ljava_lang_String_IHandler:Android.Content.Res.Loader.IAssetsProvider, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=30)]
public virtual Android.Content.Res.AssetFileDescriptor? LoadAssetFd (string path, int accessMode);
[<Android.Runtime.Register("loadAssetFd", "(Ljava/lang/String;I)Landroid/content/res/AssetFileDescriptor;", "GetLoadAssetFd_Ljava_lang_String_IHandler:Android.Content.Res.Loader.IAssetsProvider, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=30)>]
abstract member LoadAssetFd : string * int -> Android.Content.Res.AssetFileDescriptor
override this.LoadAssetFd : string * int -> Android.Content.Res.AssetFileDescriptor

Parameters

path
String

the asset path being loaded

accessMode
Int32

the AssetManager access mode

Returns

Attributes

Remarks

Callback that allows the value of a file-based resources or asset to be specified or overridden.

The system will take ownership of the file descriptor returned from this method, so ParcelFileDescriptor#dup() dup the file descriptor before returning if the system should not own it.

There are two situations in which this method will be called: <ul> <li>AssetManager is queried for an InputStream of an asset using APIs like AssetManager#open and AssetManager#openXmlResourceParser. <li>AssetManager is resolving the value of a file-based resource provided by the ResourcesProvider this instance is associated with. </ul>

If the value retrieved from this callback is null, AssetManager will attempt to find the file-based resource or asset within the APK provided by the ResourcesProvider this instance is associated with.

Java documentation for android.content.res.loader.AssetsProvider.loadAssetFd(java.lang.String, int).

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