How to Set Wallpaper
Code snippet
<uses-permission android:name = "android.permission.SET_WALLPAPER"/>
public void setWallPaper() {
WallpaperManager mWallManager = WallpaperManager.getInstance(context);
try {
mWallManager.setResource(R.drawable.wallpaperCos);
mHandler.obtainMessage(2, "set setWallPaper success...").sendToTarget();
} catch (Exception e) {
e.printStackTrace();
mHandler.obtainMessage(3, "set setWallPaper fail...").sendToTarget();
}
}
Demo Project
Please get the whole demo.