1. The code is:
2. And you must add the following permissions in your manifest:
3. [color=red]You must push your apk to /system/app. If not, it can’t work.[/color]
private WallpaperManager mWallpaperManager = WallpaperManager.getInstance(this);
Intent intent = new Intent(WallpaperService.SERVICE_INTERFACE);
intent.setClassName("com.android.wallpaper",
"com.android.wallpaper.galaxy.GalaxyWallpaper"); // you can set any live wall paper which you want
try {
mWallpaperManager.getIWallpaperManager().setWallpaperComponent(
intent.getComponent());
} catch (RemoteException e) {
e.printStackTrace();
// do nothing
} catch (RuntimeException e) {
e.printStackTrace();
}
2. And you must add the following permissions in your manifest:
<uses-permission android:name="android.permission.SET_WALLPAPER_COMPONENT" />
<uses-permission android:name="android.permission.BIND_WALLPAPER" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
3. [color=red]You must push your apk to /system/app. If not, it can’t work.[/color]