Compartilhar via


WallpaperManager Class

Definition

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
WallpaperManager
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().

Java documentation 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

WallpaperManager(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

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: reported by the wallpaper host when the user drops an object into an area of the host.

CommandSecondaryTap

Command for #sendWallpaperCommand: 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: 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

BuiltInDrawable

Obtain a drawable for the built-in static system wallpaper.

Class

Returns the runtime class of this Object.

(Inherited from Object)
DesiredMinimumHeight

Returns the desired minimum height for the wallpaper.

DesiredMinimumWidth

Returns the desired minimum width for the wallpaper.

Drawable

<strong> Important note: </strong> <ul> <li>Up to version S, this method requires the android.Manifest.permission#READ_EXTERNAL_STORAGE permission.

FastDrawable

<strong> Important note: </strong> <ul> <li>Up to version S, this method requires the android.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 (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

WallpaperInfo

Returns the information about the home screen wallpaper if its current wallpaper is a live wallpaper component.

Methods

AddOnColorsChangedListener(WallpaperManager+IOnColorsChangedListener, Handler)
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()

Reset all wallpaper to the factory default.

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)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
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)

<strong> Important note: </strong> <ul> <li>Up to version S, this method requires the android.Manifest.permission#READ_EXTERNAL_STORAGE permission.

GetFastDrawable(WallpaperManagerFlags)

<strong> Important note: </strong> <ul> <li>Up to version S, this method requires the android.Manifest.permission#READ_EXTERNAL_STORAGE permission.

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)

<strong> Important note: </strong> <ul> <li>Up to version S, this method requires the android.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 home screen 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()

<strong> Important note: </strong> <ul> <li>Up to version S, this method requires the android.Manifest.permission#READ_EXTERNAL_STORAGE permission.

PeekDrawable(WallpaperManagerFlags)

<strong> Important note: </strong> <ul> <li>Up to version S, this method requires the android.Manifest.permission#READ_EXTERNAL_STORAGE permission.

PeekFastDrawable()

<strong> Important note: </strong> <ul> <li>Up to version S, this method requires the android.Manifest.permission#READ_EXTERNAL_STORAGE permission.

PeekFastDrawable(WallpaperManagerFlags)

<strong> Important note: </strong> <ul> <li>Up to version S, this method requires the android.Manifest.permission#READ_EXTERNAL_STORAGE permission.

RemoveOnColorsChangedListener(WallpaperManager+IOnColorsChangedListener)
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)
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>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (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

ColorsChanged

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to