WallpaperManager Class
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.
Provides access to the system wallpaper.
[Android.Runtime.Register("android/app/WallpaperManager", DoNotGenerateAcw=true)]
public class WallpaperManager : Java.Lang.Object
[<Android.Runtime.Register("android/app/WallpaperManager", DoNotGenerateAcw=true)>]
type WallpaperManager = class
inherit Object
- Inheritance
- Attributes
Remarks
Provides access to the system wallpaper. With WallpaperManager, you can get the current wallpaper, get the desired dimensions for the wallpaper, set the wallpaper, and more. An app can check whether wallpapers are supported for the current user, by calling isWallpaperSupported(), and whether setting of wallpapers is allowed, by calling isSetWallpaperAllowed(). Any public APIs added to WallpaperManager should have a corresponding stub in ERROR(DisabledWallpaperManager/android.app.DisabledWallpaperManager DisabledWallpaperManager).
Android reference for android.app.WallpaperManager.
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.
Constructors
| Name | Description |
|---|---|
| WallpaperManager(IntPtr, JniHandleOwnership) |
Initializes a managed representation of an existing Java Native Interface object. |
Fields
| Name | Description |
|---|---|
| ActionChangeLiveWallpaper |
Directly launch live wallpaper preview, allowing the user to immediately confirm to switch to a specific live wallpaper. |
| ActionCropAndSetWallpaper |
Activity Action: Show settings for choosing wallpaper. |
| ActionLiveWallpaperChooser |
Launch an activity for the user to pick the current global live wallpaper. |
| CommandDrop |
Command for sendWallpaperCommand(IBinder, String, int, int, int, Bundle): reported by the wallpaper host when the user drops an object into an area of the host. |
| CommandSecondaryTap |
Command for sendWallpaperCommand(IBinder, String, int, int, int, Bundle): reported by the wallpaper host when the user releases a secondary pointer on an empty area (not performing an action in the host). |
| CommandTap |
Command for sendWallpaperCommand(IBinder, String, int, int, int, Bundle): reported by the wallpaper host when the user taps on an empty area (not performing an action in the host). |
| ExtraLiveWallpaperComponent |
Extra in ACTION_CHANGE_LIVE_WALLPAPER that specifies the ComponentName of a live wallpaper that should be shown as a preview, for the user to confirm. |
| FlagLock |
Obsolete.
Flag: set or retrieve the lock-screen-specific wallpaper. |
| FlagSystem |
Obsolete.
Flag: set or retrieve the general system wallpaper. |
| WallpaperPreviewMetaData |
Manifest entry for activities that respond to Intent.ACTION_SET_WALLPAPER which allows them to provide a custom large icon associated with this action. |
Properties
| Name | Description |
|---|---|
| BuiltInDrawable |
Obtain a drawable for the built-in static system wallpaper. |
| Class |
Returns the runtime class of this |
| DesiredMinimumHeight |
Returns the desired minimum height for the wallpaper. |
| DesiredMinimumWidth |
Returns the desired minimum width for the wallpaper. |
| Drawable |
Important note: Up to Android 12, this method requires the Manifest.permission.READ_EXTERNAL_STORAGE permission. |
| FastDrawable |
Important note: Up to Android 12, this method requires the Manifest.permission.READ_EXTERNAL_STORAGE permission. |
| Handle |
The handle to the underlying Android instance. (Inherited from Object) |
| IsSetWallpaperAllowed |
Returns whether the calling package is allowed to set the wallpaper for the calling user. |
| IsWallpaperSupported |
Returns whether wallpapers are supported for the calling user. |
| JniIdentityHashCode |
Gets the identity hash code assigned to this Java peer by the interop runtime. (Inherited from Object) |
| JniManagedPeerState | (Inherited from JavaObject) |
| JniPeerMembers |
Provides JNI binding infrastructure for Android.App.WallpaperManager. |
| PeerReference |
Gets the JNI object reference for this Java peer. (Inherited from Object) |
| ThresholdClass |
Provides JNI binding infrastructure for Android.App.WallpaperManager. |
| ThresholdType |
Provides JNI binding infrastructure for Android.App.WallpaperManager. |
| WallpaperInfo |
Returns the information about the home screen wallpaper if its current wallpaper is a live wallpaper component. |
Methods
| Name | Description |
|---|---|
| AddOnColorsChangedListener(WallpaperManager+IOnColorsChangedListener, Handler) |
Registers a listener to get notified when the wallpaper colors change. |
| Clear() |
Remove any currently set system wallpaper, reverting to the system's built-in wallpaper. |
| Clear(WallpaperManagerFlags) |
Remove one or more currently set wallpapers, reverting to the system default display for each one. |
| ClearWallpaper() |
Equivalent to clear(). |
| ClearWallpaperOffsets(IBinder) |
Clear the offsets previously associated with this window through setWallpaperOffsets(IBinder,float,float). |
| Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
| Construct(JniObjectReference, JniObjectReferenceOptions) | (Inherited from JavaObject) |
| Dispose() |
Releases the resources held by this Java peer. (Inherited from Object) |
| Dispose(Boolean) |
Releases the resources held by this Java peer. (Inherited from Object) |
| DisposeUnlessReferenced() | (Inherited from JavaObject) |
| Equals(Object) | (Inherited from JavaObject) |
| Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
| ForgetLoadedWallpaper() |
Remove all internal references to the last loaded wallpaper. |
| GetBuiltInDrawable(Int32, Int32, Boolean, Single, Single, WallpaperManagerFlags) |
Returns a drawable for the built-in static wallpaper of the specified type. |
| GetBuiltInDrawable(Int32, Int32, Boolean, Single, Single) |
Returns a drawable for the system built-in static wallpaper. |
| GetBuiltInDrawable(WallpaperManagerFlags) |
Obtain a drawable for the specified built-in static system wallpaper. |
| GetCropAndSetWallpaperIntent(Uri) |
Gets an Intent that will launch an activity that crops the given image and sets the device's wallpaper. |
| GetDrawable(WallpaperManagerFlags) |
Important note: only apps with Manifest.permission.MANAGE_EXTERNAL_STORAGE should use this method. |
| GetFastDrawable(WallpaperManagerFlags) |
Important note: only apps with Manifest.permission.MANAGE_EXTERNAL_STORAGE should use this method. |
| GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
| GetInstance(Context) |
Retrieve a WallpaperManager associated with the given Context. |
| GetWallpaperColors(Int32) |
Get the primary colors of a wallpaper. |
| GetWallpaperFile(WallpaperManagerFlags) |
Important note: Up to Android 12, this method requires the Manifest.permission.READ_EXTERNAL_STORAGE permission. |
| GetWallpaperId(WallpaperManagerFlags) |
Get the ID of the current wallpaper of the given kind. |
| GetWallpaperInfo(WallpaperManagerFlags) |
Returns the information about the designated wallpaper if its current wallpaper is a live wallpaper component. |
| HasResourceWallpaper(Int32) |
Return whether any users are currently set to use the wallpaper with the given resource ID. |
| JavaFinalize() |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
| Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
| NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
| 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. |
| PeekFastDrawable() |
Important note: only apps with Manifest.permission.MANAGE_EXTERNAL_STORAGE should use this method. |
| PeekFastDrawable(WallpaperManagerFlags) |
Important note: only apps with Manifest.permission.MANAGE_EXTERNAL_STORAGE should use this method. |
| RemoveOnColorsChangedListener(WallpaperManager+IOnColorsChangedListener) |
Stop listening to color updates. |
| SendWallpaperCommand(IBinder, String, Int32, Int32, Int32, Bundle) |
Send an arbitrary command to the current active wallpaper. |
| SetBitmap(Bitmap, Rect, Boolean, WallpaperManagerFlags) |
Version of setBitmap(Bitmap,Rect,boolean) that allows the caller to specify which of the supported wallpaper categories to set. |
| SetBitmap(Bitmap, Rect, Boolean) |
Change the current system wallpaper to a bitmap, specifying a hint about which subrectangle of the full image is to be visible. |
| SetBitmap(Bitmap) |
Change the current system wallpaper to a bitmap. |
| SetDisplayPadding(Rect) |
Specify extra padding that the wallpaper should have outside of the display. |
| SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
| SetPeerReference(JniObjectReference, JniObjectReferenceOptions) | (Inherited from JavaObject) |
| SetResource(Int32, WallpaperManagerFlags) |
Version of setResource(int) that allows the caller to specify which of the supported wallpaper categories to set. |
| SetResource(Int32) |
Change the current system wallpaper to the bitmap in the given resource. |
| SetStream(Stream, Rect, Boolean, WallpaperManagerFlags) |
Version of setStream(InputStream,Rect,boolean) that allows the caller to specify which of the supported wallpaper categories to set. |
| SetStream(Stream, Rect, Boolean) |
Change the current system wallpaper to a specific byte stream, specifying a hint about which subrectangle of the full image is to be visible. |
| SetStream(Stream) |
Change the current system wallpaper to a specific byte stream. |
| SetWallpaperOffsets(IBinder, Single, Single) |
Set the display position of the current wallpaper within any larger space, when that wallpaper is visible behind the given window. |
| SetWallpaperOffsetSteps(Single, Single) |
For applications that use multiple virtual screens showing a wallpaper, specify the step size between virtual screens. |
| SuggestDesiredDimensions(Int32, Int32) |
For use only by the current home application, to specify the size of wallpaper it would like to use. |
| ToArray<T>() |
Creates a managed array from this Java array wrapper. (Inherited from Object) |
| ToString() |
Returns a string representation of the object. (Inherited from Object) |
| UnregisterFromRuntime() |
Unregisters this Java peer from the interop runtime. (Inherited from Object) |
| Wait() |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>. (Inherited from Object) |
| Wait(Int64, Int32) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
| Wait(Int64) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Events
| Name | Description |
|---|---|
| ColorsChanged | |
Explicit Interface Implementations
| Name | Description |
|---|---|
| IJavaPeerable.Disposed() | (Inherited from JavaObject) |
| IJavaPeerable.Finalized() | (Inherited from JavaObject) |
| IJavaPeerable.JniObjectReferenceControlBlock | (Inherited from JavaObject) |
| IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from JavaObject) |
| IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from JavaObject) |
| IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from JavaObject) |
Extension Methods
| Name | Description |
|---|---|
| GetJniTypeName(IJavaPeerable) |
Gets the JNI name of the type of the instance |
| JavaAs<TResult>(IJavaPeerable) |
Try to coerce |
| JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
| JavaCast<TResult>(IJavaObject) | |
| TryJavaCast<TResult>(IJavaPeerable, TResult) |
Try to coerce |