5

Is it possible to set some of the live wallpapers as a background of an activity ?

Lukap
  • 31,523
  • 64
  • 157
  • 244

2 Answers2

12

Sure, just add this attribute to your <activity> tag in the manifest:

android:theme="@android:style/Theme.Wallpaper"
Josh
  • 10,618
  • 2
  • 32
  • 36
  • 1
    This is very nice, but I need just one more thing :-). This set as background my current wallpaper. How can I set different background than the current wallpaper ? – Lukap Aug 04 '11 at 07:46
  • Are you saying you'd like your users to be able to set the background of your app to one of the currently installed wallpapers? Or only that your app should have a live wallpaper background that is included with the app? – Josh Aug 04 '11 at 12:42
  • I want my app ( my activity ) to have wallpaper as background. But I do not want the current wallpaper of the phone, I want to set the background of my activity to some of the installed wallpapers. – Lukap Aug 04 '11 at 12:46
  • I don't believe that's possible. Why would your user want to customize your app's background to something OTHER than the one they are currently using? Sounds like an unnecessary feature, IMO. – Josh Aug 04 '11 at 13:10
  • It sound unnecessary to you and me but not to my boss. I think this should be possible, I do not see problem having one wallpaper on the home screen and other wallpaper as background of the activity. – Lukap Aug 04 '11 at 13:14
  • Haha understood. I don't think you have access to the individual live wallpapers, only the theme above. Sorry! – Josh Aug 04 '11 at 13:18
  • Been thinking some more about this. If your boss would be content with providing pre-packaged animated backgrounds, that would sort of make up for the lack of live wallpaper support. Simply use a SurfaceView as the lowest layer of your layout hierarchy, and render animations to that. – Josh Aug 05 '11 at 12:03
  • @Josh: I would like to set the background of the app to one of the live wall paper backgrounds that is included in the app. How might I do this? – the_prole Jul 20 '14 at 11:47
  • Hey Prole, post a new question and link it here and I can go over some options. – Josh Jul 21 '14 at 19:08
1

This is possible and was displayed at the Google I/O 2010. If you watch this video about 34m40s into the presentation you can see that the google developers utilise shipped live wallpapers as background for an activity.

https://www.youtube.com/watch?v=M1ZBjlCRfz0&feature=youtube_gdata_player

Don't know where an example is.... but it CAN be done.

Muad'Dib
  • 511
  • 4
  • 11