Skip to content

Instantly share code, notes, and snippets.

@tediscript
Created March 23, 2013 16:57
Show Gist options
  • Select an option

  • Save tediscript/5228437 to your computer and use it in GitHub Desktop.

Select an option

Save tediscript/5228437 to your computer and use it in GitHub Desktop.
Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), R.id.full_image_view);
WallpaperManager myWallpaperManager = WallpaperManager
.getInstance(getApplicationContext());
try {
myWallpaperManager.setBitmap(mBitmap);
Toast.makeText(SetWallPaper.this, "Wallpaper set",
Toast.LENGTH_SHORT).show();
} catch (IOException e) {
Toast.makeText(SetWallPaper.this,
"Error setting wallpaper", Toast.LENGTH_SHORT)
.show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment