开发者

How can I get Phone wallpaper in Android?

开发者 https://www.devze.com 2023-02-10 14:24 出处:网络
I am working on an Android applic开发者_StackOverflow社区ation. How can I get Phone wallpaper in Android? Please help me. Give me the sample code example.You need to use WallpaperManager which, among

I am working on an Android applic开发者_StackOverflow社区ation. How can I get Phone wallpaper in Android? Please help me. Give me the sample code example.


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();


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


From your activity call

this.getWallpaper();


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

0

精彩评论

暂无评论...
验证码 换一张
取 消