WallpaperManager.PeekDrawable Method

Definition

Overloads

Name Description
PeekDrawable()

Important note: Up to Android 12, this method requires the Manifest.permission.READ_EXTERNAL_STORAGE permission.

PeekDrawable(WallpaperManagerFlags)

Important note: only apps with Manifest.permission.MANAGE_EXTERNAL_STORAGE should use this method.

PeekDrawable()

Important note: Up to Android 12, this method requires the Manifest.permission.READ_EXTERNAL_STORAGE permission.

[Android.Runtime.Register("peekDrawable", "()Landroid/graphics/drawable/Drawable;", "GetPeekDrawableHandler")]
public virtual Android.Graphics.Drawables.Drawable? PeekDrawable();
[<Android.Runtime.Register("peekDrawable", "()Landroid/graphics/drawable/Drawable;", "GetPeekDrawableHandler")>]
abstract member PeekDrawable : unit -> Android.Graphics.Drawables.Drawable
override this.PeekDrawable : unit -> Android.Graphics.Drawables.Drawable

Returns

A Drawable object for the requested wallpaper. This value may be null.

Attributes

Remarks

Important note: Up to Android 12, this method requires the Manifest.permission.READ_EXTERNAL_STORAGE permission. Starting in Android 13, directly accessing the wallpaper is not possible anymore, instead the default system wallpaper is returned (some versions of Android 13 may throw a SecurityException). From Android 14, this method should not be used and will always throw a SecurityException. Apps with Manifest.permission.MANAGE_EXTERNAL_STORAGE can still access the real wallpaper on all versions. Equivalent to getDrawable().

See also:

Throws: SecurityException as described in the note

Android reference for android.app.WallpaperManager.peekDrawable.

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

PeekDrawable(WallpaperManagerFlags)

Important note: only apps with Manifest.permission.MANAGE_EXTERNAL_STORAGE should use this method.

[Android.Runtime.Register("peekDrawable", "(I)Landroid/graphics/drawable/Drawable;", "GetPeekDrawable_IHandler", ApiSince=34)]
public virtual Android.Graphics.Drawables.Drawable? PeekDrawable(Android.App.WallpaperManagerFlags which);
[<Android.Runtime.Register("peekDrawable", "(I)Landroid/graphics/drawable/Drawable;", "GetPeekDrawable_IHandler", ApiSince=34)>]
abstract member PeekDrawable : Android.App.WallpaperManagerFlags -> Android.Graphics.Drawables.Drawable
override this.PeekDrawable : Android.App.WallpaperManagerFlags -> Android.Graphics.Drawables.Drawable

Parameters

which
WallpaperManagerFlags

int: The FLAG_* identifier of a valid wallpaper type. Throws IllegalArgumentException if an invalid wallpaper is requested. Value is either 0 or a combination of the following: FLAG_SYSTEM FLAG_LOCK

Returns

A Drawable object for the requested wallpaper. This value may be null.

Attributes

Remarks

Important note: only apps with Manifest.permission.MANAGE_EXTERNAL_STORAGE should use this method. Otherwise, a SecurityException will be thrown. Equivalent to getDrawable(int).

See also:

Throws: Parameters

Throws: SecurityException as described in the note

Android reference for android.app.WallpaperManager.peekDrawable.

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