How to change the lockscreen wallpaper in android?

18,816

Solution 1

This is now possible with the updated Android API in API Level 24.

You have to provide the target WallpaperManager.FLAG_LOCK flag via the setResource method.

int setResource (int resid, int which)

See the updated documentation for the WallpaperManager

Solution 2

Edit: See Mikepenz's answer for API 24+.

According to CommonsWare (who generally knows what he's talking about), there's no such thing as a lockscreen wallpaper, and there's no way of changing the lock screen background through the API.

See https://stackoverflow.com/a/2654241/153225.

Share:
18,816
Navjot
Author by

Navjot

Solution-oriented and passionate Mobile Application Developer with 9.5 years of professional experience in analysis, design and development of applications for both Android and iOS. Expertise in effectively leading and managing well-talented teams working for US and Canada based clients. Highly proficient in strategising successful releases with high standard code quality, documentation, and deliverables. I believe that the technology is at its best when it's simply invisible, when it just works. I like creating products that look simple/clear from the outside, at the same time having a high potential of technology inside.

Updated on July 21, 2022

Comments

  • Navjot
    Navjot almost 2 years

    I want to change the lockscreen wallpaper of android. I was able to change home screen wallpaper through WallpaperManager.setResource

    But not able to set LockScreen Wallpaper

  • Nick
    Nick almost 11 years
    Also this does not specifically set the lockscreen background only the phones background.
  • Sandro Machado
    Sandro Machado over 7 years
    So it is not possible to use live wallpapers, right? I read the documentation and I only found options to bitmap.
  • Bipin Bharti
    Bipin Bharti over 7 years
    please give proper answer