In Android we can set wallpaper progrmatically using WallpaperManager class.and one SET_WALLPAPER Permistion in AndroidManifest file
Example code :
Use this Permission in AndroidManifest file
<uses-permission android:name="android.permission.SET_WALLPAPER"/>
(Copy Below code in Android Activity)
//code to get a wallpaperManager instance and use setResouce method to set wallpaper
WallpaperManager WallpaperManager = WallpaperManager
.getInstance(getApplicationContext());
WallpaperManager.setResource(R.drawable.wall);
No comments:
Post a Comment