Reputation: 709
I am working on an Android application. How can I get Phone wallpaper in Android? Please help me. Give me the sample code example.
Upvotes: 4
Views: 3319
Reputation: 338
final WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
final Drawable wallpaperDrawable = wallpaperManager.getDrawable();
Upvotes: 1
Reputation: 5365
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();
Upvotes: 11
Reputation: 15269
Wallpaper can be get using getDrawable() of Wallpaper class How can I get Phone wallpaper in Android?
Upvotes: -1