Partager via


Environment.InvokeIsExternalStorageLegacy(File) Method

Definition

Returns whether the shared/external storage media is a legacy view that includes files not owned by the app.

[Android.Runtime.Register("isExternalStorageLegacy", "(Ljava/io/File;)Z", "", ApiSince=29)]
public static bool InvokeIsExternalStorageLegacy (Java.IO.File path);
[<Android.Runtime.Register("isExternalStorageLegacy", "(Ljava/io/File;)Z", "", ApiSince=29)>]
static member InvokeIsExternalStorageLegacy : Java.IO.File -> bool

Parameters

path
File

Returns

Attributes

Remarks

Returns whether the shared/external storage media is a legacy view that includes files not owned by the app.

This value may be different from the value requested by requestLegacyExternalStorage in the app's manifest, since an app may inherit its legacy state based on when it was first installed, target sdk and other factors.

Non-legacy apps can continue to discover and read media belonging to other apps via android.provider.MediaStore.

Java documentation for android.os.Environment.isExternalStorageLegacy(java.io.File).

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