2

我想获取手机当前的壁纸并将该图像设置为应用程序的背景图像。我试过这种方式,但它显示运行时异常

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

1 回答 1

1
 final WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
 final Drawable wallpaperDrawable = wallpaperManager.getFastDrawable();
 getWindow().setBackgroundDrawable(wallpaperDrawable);
于 2013-10-12T16:53:39.553 回答