Mayur R. Amipara
Mayur R. Amipara

Reputation: 1223

how to get current wallpaper information in android?

I want to retrieve info about current Wallpaper like its name, path, etc. Is this possible, and if so, how can I do it?

I am currently calling WallpaperManager in service at some part of my code.

Does android provide any inbuilt function or method for this?

Upvotes: 1

Views: 2330

Answers (1)

Rajan Bhavsar
Rajan Bhavsar

Reputation: 1857

H i would like to share the code to get the Current Wallpaper Drawable Image as follows :

final WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);

final Drawable wallpaperDrawable = wallpaperManager.getDrawable();

And If Your current Wallpaper is Of the Live Wallpaper than You were able to get the Information by simple code as :

wallpaperManager.getWallpaperInfo();

which returns the Object of WallPaperInfo Class and You are able to retrived the data.

Upvotes: 1

Related Questions