Is it possible to change the background image of the home screen from an app? If so how? If not, well, just say so. Thanks in advanced!
+2
A:
Since API Level 5 (I believe that's Android 1.6? I may be mistaken) there is the WallpaperManager class that you can use to do this.
Simply create an instance using getInstance()
, then use one of the set
methods (setBitmap()
, setResource()
, or setStream()
) to apply the wallpaper.
For instance:
WallpaperManager wm = WallpaperManager.getInstance(this);
wm.setBitmap(myBitmap);
kcoppock
2010-10-21 20:52:46
Thanks alot!!!!
Jack Love
2010-10-21 21:00:21
So if I wanted to set the background to a drawable, what would the code be?
Jack Love
2010-10-21 21:22:52
You'd actually first have to convert the Drawable to a Bitmap, since there's no setDrawable method.
kcoppock
2010-10-21 21:27:53