Android.App.WallpaperManager.SetResource Method
Change the current system wallpaper to the bitmap in the given resource.

Syntax

[Android.Runtime.Register("setResource", "(I)V", "GetSetResource_IHandler")]
public virtual void SetResource (int resid)

Parameters

resid
The bitmap to save.

Exceptions

TypeReason
Java.IO.IOExceptionIf an error occurs reverting to the built-in wallpaper.

Remarks

Change the current system wallpaper to the bitmap in the given resource. The resource is opened as a raw data stream and copied into the wallpaper; it must be a valid PNG or JPEG image. On success, the intent Android.Content.Intent.ActionWallpaperChanged is broadcast.

This method requires the caller to hold the permission NoType:android/Manifest$permission;Href=../../../reference/android/Manifest.permission.html#SET_WALLPAPER.

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 5