Android using background from home page

Question:

I want to use the background from the wallpaper from the main page in the application, I found that they used to do it like this:

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

I ask in the style:

<item name="android:windowBackground">@android:theme="android:style/Theme.Wallpaper"</item>

After that, an error is sent to the application. Can't you do it through styles and you need to change the whole theme? or does it not work now?

PS It is clear that this is not correct, since I do not have the Theme.Wallpaper style. I am asking for a hint on how to use the desktop picture.

Answer:

Here they write that you can get a Drawable wallpaper like this:

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