开发者

Changing Home Background

开发者 https://www.devze.com 2023-01-21 14:55 出处:网络
Is it possible to change the background image of the home screen from an app? If so how开发者_JAVA百科?Since API Level 5 (I believe that\'s Android 1.6? I may be mistaken) there is the WallpaperMana

Is it possible to change the background image of the home screen from an app?

If so how开发者_JAVA百科?


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);
0

精彩评论

暂无评论...
验证码 换一张
取 消