1)代码方式
Drawable wallPaper
= WallpaperManager.getInstance( this).getDrawable();
this.getWindow().setBackgroundDrawable(wallPaper);
2)XML配置
在该Activity的配置中,加上:
android:theme = "@android:style/Theme.Wallpaper“
第一种方法的缺点是墙纸的大小和Activity的尺寸可能不一致,导致墙纸拉伸,需要做额外处理
第二种方法的缺点是,ActionBar没了。。。