Honzo
Honzo

Reputation: 103

How to set an applications background the same as the current background?

I am trying to figure out some way to determine the current background on a phone and then set that background as my own in my application to create a seamless transition between my application and the phone. However I haven't been able to find any functions for this at Androids SDK site.

Setting android:theme="@style/Theme.NoBackground" inside my Manifest almost does what I want, but it still has the icons in the background.

Thanks in advance

Upvotes: 1

Views: 740

Answers (4)

user1639529
user1639529

Reputation:

Try to use the following code in your program, so that you can overcome your problem:

activity android:theme="@android:style/Theme.Wallpaper"

this will help for you.

Upvotes: 1

Cytown
Cytown

Reputation: 1547

You can do call this.getWallpaper() in your Activity in prior 2.0.

Upvotes: 0

Roman Nurik
Roman Nurik

Reputation: 29745

You should also be able to declare in your manifest that your activity should use the 'wallpaper' theme, like so:

<activity android:theme="@android:style/Theme.Wallpaper">

Upvotes: 1

Honzo
Honzo

Reputation: 103

Yeah the WallpaperManager was the answer, a little searching revealed this in one of the API Demos for anyone who needs this.

final WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
final Drawable wallpaperDrawable = wallpaperManager.getDrawable();

Obviously add the variable wallpaperDrawable to setBackgroundDrawable();

Upvotes: 1

Related Questions