Armen Hovhannisian
Armen Hovhannisian

Reputation: 952

Set lock screen wallpaper of Android device programmatically

There is bunch of wallpaper applications where you can change lock screen wallpaper separate from main wallpaper. If I am not mistaken from API 24 it is possible to do such kind of thing, but I find very few articles related to this besides they are TOO old.

Upvotes: 1

Views: 7128

Answers (2)

Armen Hovhannisian
Armen Hovhannisian

Reputation: 952

wallpaperManager.setBitmap(bitmap, null, true, WallpaperManager.FLAG_LOCK)

Upvotes: 2

kabuko
kabuko

Reputation: 36302

WallpaperManager has a number of methods to help you get or set the specific wallpapers. As you want the lock screen wallpaper, use FLAG_LOCK. Relevant methods include:

getWallpaperFile(int)

setBitmap(Bitmap fullImage, Rect visibleCropHint, boolean allowBackup, int which)

Upvotes: 7

Related Questions