다음을 통해 공유


WallpaperManager.GetFastDrawable(WallpaperManagerFlags) Method

Definition

<strong> Important note: </strong> only apps with android.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

The FLAG_* identifier of a valid wallpaper type. Throws IllegalArgumentException if an invalid wallpaper is requested.

Returns

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

Attributes

Remarks

<strong> Important note: </strong> only apps with android.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).

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