Android壁纸

Posted by qkmin on December 15, 2019

#设置壁纸方法

WallpaperManager wallpaperManager = (WallpaperManager) mActivity.getSystemService(
                        Context.WALLPAPER_SERVICE);
wallpaperManager.setBitmap();
wallpaperManager.setResource();
wallpaperManager.setStream();

#设置壁纸需要的权限

<uses-permission android:name="android.permission.SET_WALLPAPER"/>

#获取壁纸方法

WallpaperManager wallpaperManager = (WallpaperManager) mActivity.getSystemService(
                        Context.WALLPAPER_SERVICE);
wallpaperManager.getDrawable()