Wednesday, 15 September 2010

java - How to update an activitys background when it's set to the systems wallpaper? -


I have this code which allows me to set the current device wallpaper to be my activity background.

  Public Zero Wallpaper Background () (WallpaperManager WallpaperManager = WallpaperManager.Testinstance (this); Drawing WallpaperDrawable = Wallpaper Manager.getDrawable (see; View Root = Find VeeById (R.id.home_view); root.setBackground ( WallpaperDrawable);}  

The problem is, if I have to go through settings I do not update the wallpaper on my app and I have been left with the previous wallpaper how can I fix it?

It's really quite simple:

Just call your wallpaperBackground () in the method onResume () In your activity.

This will automatically apply the correct wallpaper when the user will restart the activity from another app.


No comments:

Post a Comment