10

Since Android API Level 24 the methods to set the wallpaper accept a parameter to be possible to specify which wallpaper we want to set (Lock or System).

Unfortunately, I don't find a way to use it with Live Wallpapers. The methods available in the WallpaperManager class only support images or an InputStreams. They don't support Live Wallpapers.

Some Samsung devices accept the following code:

Intent intent = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
intent.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT, new ComponentName(this, LiveWallpaperService.class));
intent.putExtra("SET_LOCKSCREEN_WALLPAPER", true);

But this does only work on some the devices.

There is any other method available to programatically set a Live Wallpaper to the Lock Screen?

Sandro Machado
  • 9,921
  • 4
  • 36
  • 57

0 Answers0