WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
ParcelFileDescriptor pfdLock = wallpaperManager.getWallpaperFile(WallpaperManager.FLAG_SYSTEM);
if (pfdLock != null) {
Bitmap bitmap = BitmapFactory.decodeFileDescriptor(pfdLock.getFileDescriptor());
Drawable drawable = new BitmapDrawable(getResources(), bitmap);
ColorDrawable maskDrawable = new ColorDrawable(0x80000000);
Drawable[] layers = new Drawable[2];
layers[0] = drawable;
layers[1] = maskDrawable;
LayerDrawable layerDrawable = new LayerDrawable(layers);
getRootView().setBackground(layerDrawable);
}
07-27
1万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)