Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get Phone wallpaper in Android?

Tags:

android

I am working on an Android application. How can I get Phone wallpaper in Android? Please help me. Give me the sample code example.

like image 358
user533787 Avatar asked Dec 21 '22 17:12

user533787


1 Answers

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

The following snippet will get the current wallpaper (or the system default if no wallpaper is set).

final WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
final Drawable wallpaperDrawable = wallpaperManager.getDrawable();
like image 179
sahhhm Avatar answered Jan 08 '23 22:01

sahhhm