Partager via


WallpaperManager.GetWallpaperFile(WallpaperManagerFlags) Method

Definition

<strong> Important note: </strong> <ul> <li>Up to version S, this method requires the android.Manifest.permission#READ_EXTERNAL_STORAGE permission.

[Android.Runtime.Register("getWallpaperFile", "(I)Landroid/os/ParcelFileDescriptor;", "GetGetWallpaperFile_IHandler", ApiSince=24)]
public virtual Android.OS.ParcelFileDescriptor? GetWallpaperFile (Android.App.WallpaperManagerFlags which);
[<Android.Runtime.Register("getWallpaperFile", "(I)Landroid/os/ParcelFileDescriptor;", "GetGetWallpaperFile_IHandler", ApiSince=24)>]
abstract member GetWallpaperFile : Android.App.WallpaperManagerFlags -> Android.OS.ParcelFileDescriptor
override this.GetWallpaperFile : Android.App.WallpaperManagerFlags -> Android.OS.ParcelFileDescriptor

Parameters

which
WallpaperManagerFlags

The wallpaper whose image file is to be retrieved. Must be a single defined kind of wallpaper, either #FLAG_SYSTEM or #FLAG_LOCK.

Returns

An open, readable file descriptor to the requested wallpaper image file; or null if no such wallpaper is configured or if the calling app does not have permission to read the current wallpaper.

Attributes

Remarks

<strong> Important note: </strong> <ul> <li>Up to version S, this method requires the android.Manifest.permission#READ_EXTERNAL_STORAGE permission.</li> <li>Starting in T, directly accessing the wallpaper is not possible anymore, instead the default system wallpaper is returned (some versions of T may throw a SecurityException).</li> <li>From version U, this method should not be used and will always throw a

Java documentation for android.app.WallpaperManager.getWallpaperFile(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