WallpaperManager.GetDrawable(WallpaperManagerFlags) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Important note: only apps with Manifest.permission.MANAGE_EXTERNAL_STORAGE should use this method.
[Android.Runtime.Register("getDrawable", "(I)Landroid/graphics/drawable/Drawable;", "GetGetDrawable_IHandler", ApiSince=34)]
public virtual Android.Graphics.Drawables.Drawable? GetDrawable(Android.App.WallpaperManagerFlags which);
[<Android.Runtime.Register("getDrawable", "(I)Landroid/graphics/drawable/Drawable;", "GetGetDrawable_IHandler", ApiSince=34)>]
abstract member GetDrawable : Android.App.WallpaperManagerFlags -> Android.Graphics.Drawables.Drawable
override this.GetDrawable : Android.App.WallpaperManagerFlags -> Android.Graphics.Drawables.Drawable
Parameters
- which
- WallpaperManagerFlags
The wallpaper type: either System or Lock. An invalid value can cause an IllegalArgumentException.
Returns
A Drawable object for the requested wallpaper.
- Attributes
Remarks
Important note: only apps with Manifest.permission.MANAGE_EXTERNAL_STORAGE should use this method. Otherwise, a SecurityException will be thrown. Retrieve the requested wallpaper for the specified wallpaper type if the wallpaper is not a live wallpaper. This method should not be used to display the user wallpaper on an app: WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER should be used instead.
When called with which=FLAG_SYSTEM, if there is a live wallpaper on home screen, the built-in default wallpaper is returned.
When called with which=FLAG_LOCK, if there is a live wallpaper on lock screen, or if the lock screen and home screen share the same wallpaper engine, null is returned.
getWallpaperInfo(int) can be used to determine whether there is a live wallpaper on a specified screen type.
Throws: SecurityException as described in the note
Android reference for android.app.WallpaperManager.getDrawable.
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.