Thursday, 14 June 2012

Set Wallpaper Programmatically in Android


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

Android SQLite Database Viewer or Debuging with Stetho

Every Android Developer uses SQLite Database to store data into the Android Application data. But to view the data in SQLite have a lot of...