I would like to set a certain Drawable
as the device\'s wallpaper, but all wallpaper functions accept Bitmap
s only. I cannot use WallpaperMan
Maybe this will help someone...
From PictureDrawable to Bitmap, use:
private Bitmap pictureDrawableToBitmap(PictureDrawable pictureDrawable){
Bitmap bmp = Bitmap.createBitmap(pictureDrawable.getIntrinsicWidth(), pictureDrawable.getIntrinsicHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(bmp);
canvas.drawPicture(pictureDrawable.getPicture());
return bmp;
}
... implemented as such:
Bitmap bmp = pictureDrawableToBitmap((PictureDrawable) drawable);