Amine Amine - 2 years ago 47
Android Question

Setting wallpaper in Android

I am developing a simple app that sets wallpapers based on user input.
I am missing code for setting wallpapers.
I have been looking for it in lots of websites in vain.
Can anybody post a sample code that sets as a wallpaper as a drawable that is saved in the


Answer Source

Works on Android 1.5 and above

public void setWallpaper() {
  Context context = this.getBaseContext(); 
  Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), mImageIds[pos]);

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download