Install Live Wallpaper on Android Lock Screen

Starting from the Android 24 API level, the wallpaper installation methods accept a parameter so that you can specify which wallpaper we want to set ( Lock or System ).

Unfortunately, I did not find a way to use it with Live Wallpapers . The methods available in the WallpaperManager class only support images or InputStreams . They do not 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 only works on some devices.

Is there any other method to programmatically set Live Wallpaper to Lock Screen ?

+5
source share

Source: https://habr.com/ru/post/1260417/


All Articles