开发者

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开发者_如何学JAVA 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


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


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">


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.


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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜