Android WallpaperManager 同时设置桌面壁纸与锁屏的问题 | 您所在的位置:网站首页 › 安卓原生界面怎么设置密码锁屏 › Android WallpaperManager 同时设置桌面壁纸与锁屏的问题 |
最近项目中,需要给手机设置桌面壁纸与锁屏。 大家都知道使用 WallpaperManager.setStream()方法就好 @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public int setStream(InputStream bitmapData, Rect visibleCropHint, boolean allowBackup, @SetWallpaperFlags int which)其中,该方法的最后一个参数就是用来标记该图像是应用于桌面壁纸还是锁屏的。 @Retention(RetentionPolicy.SOURCE) public @interface SetWallpaperFlags {} /** * Flag: set or retrieve the general system wallpaper. */ public static final int FLAG_SYSTEM = 1 |
CopyRight 2018-2019 实验室设备网 版权所有 |