2009-12-30 97 views
1

我想找出一些方法来确定手机上的当前背景,然后在我的应用程序中将该背景设置为我自己的背景,以在我的应用程序和手机之间创建无缝过渡。但是,我一直无法在Androids SDK网站上找到任何此功能。如何将应用程序背景设置为与当前背景相同?

在我的Manifest中设置android:theme =“@ style/Theme.NoBackground”几乎做我想要的,但它仍然在背景中有图标。

在此先感谢

回答

1

呀WallpaperManager就是答案,一点点在搜索的人的API演示谁需要这样的一个披露这一点。

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

显然将变量wallpaperDrawable添加到setBackgroundDrawable();

+0

不要忘记“接受”您在本网站发布的问题的答案 - 只需点击最相关答案下的大“勾号”图标即可。 – 2010-01-03 19:56:17

1

你也应该能够在你的清单,宣布你的活动应该使用“墙纸”的主题,像这样:

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

你能在2.0之前调用this.getWallpaper()在你的活动。

1

尝试使用下面的代码在你的程序中,这样就可以解决你的问题:

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

这将帮助你。