How can I get an Android phone wallpaper?

I am working on an Android application. How can I get an Android phone wallpaper? Please help me. Give me an example code example.

+4
source share
4 answers

You need to use the WallpaperManager , which, among other things, is mentioned in the documentation, allows you to get the current wallpaper.

The next fragment will get the current wallpaper (or the system default if the wallpaper is not installed).

 final WallpaperManager wallpaperManager = WallpaperManager.getInstance(this); final Drawable wallpaperDrawable = wallpaperManager.getDrawable(); 
+11
source
 final WallpaperManager wallpaperManager = WallpaperManager.getInstance(this); final Drawable wallpaperDrawable = wallpaperManager.getDrawable(); 
+1
source

From your activity call

this.getWallpaper ();

0
source

Wallpaper can be obtained using the getDrawable () method for wallpaper How to get wallpaper on Android in Android?

-1
source

Source: https://habr.com/ru/post/1339945/


All Articles