WallpaperManager.GetFastDrawable(WallpaperManagerFlags) Method

Definition

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

[Android.Runtime.Register("getFastDrawable", "(I)Landroid/graphics/drawable/Drawable;", "GetGetFastDrawable_IHandler", ApiSince=34)]
public virtual Android.Graphics.Drawables.Drawable? GetFastDrawable(Android.App.WallpaperManagerFlags which);
[<Android.Runtime.Register("getFastDrawable", "(I)Landroid/graphics/drawable/Drawable;", "GetGetFastDrawable_IHandler", ApiSince=34)>]
abstract member GetFastDrawable : Android.App.WallpaperManagerFlags -> Android.Graphics.Drawables.Drawable
override this.GetFastDrawable : 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

An optimized Drawable object for the requested wallpaper, or null in some cases as specified in getDrawable(int).

Attributes

Remarks

Important note: only apps with Manifest.permission.MANAGE_EXTERNAL_STORAGE should use this method. Otherwise, a SecurityException will be thrown. Like getDrawable(int), but the returned Drawable has a number of limitations to reduce its overhead as much as possible. It will never scale the wallpaper (only centering it if the requested bounds do match the bitmap bounds, which should not be typical), doesn't allow setting an alpha, color filter, or other attributes, etc. The bounds of the returned drawable will be initialized to the same bounds as the wallpaper, so normally you will not need to touch it. The drawable also assumes that it will be used in a context running in the same density as the screen (not in density compatibility mode). Requires Manifest.permission.MANAGE_EXTERNAL_STORAGE or android.Manifest.permission.READ_WALLPAPER_INTERNAL

Throws: Parameters

Throws: SecurityException as described in the note

Android reference for android.app.WallpaperManager.getFastDrawable.

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