user533787
user533787

Reputation: 709

How can I get Phone wallpaper in 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.

Upvotes: 4

Views: 3319

Answers (4)

LairdPleng
LairdPleng

Reputation: 974

From your activity call

this.getWallpaper();

Upvotes: 0

whiteLT
whiteLT

Reputation: 338

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

Upvotes: 1

sahhhm
sahhhm

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

ingsaurabh
ingsaurabh

Reputation: 15269

Wallpaper can be get using getDrawable() of Wallpaper class How can I get Phone wallpaper in Android?

Upvotes: -1

Related Questions