admin管理员组

文章数量:1516870

最近要做一个动态桌面。就看了下动态桌面有关的东西。

1,通过WallpaperManager设置静态壁纸

1.1先通过以下方法获取到WallpaperManager

1.2这个WallpaperManager里面有多种方式设置静态壁纸,需要 android.Manifest.permission.SET_WALLPAPER这个权限不要忘记设置
1.2.1通过资源文件

这个是第二个方法,比第一个多了一个int类型的which。我们可以看到他的值android studio已经帮我们现实出来了。我们来分别说一下。
android.app.WallpaperManager.FLAG_LOCK是设置锁屏壁纸
android.app.WallpaperManager.FLAG_SYSTME是设置系统壁纸


1.2.2通过bitmap
方法一:

方法二

本文标签: 通过让你的编程