【解决】
千万不要去设置壁纸的大小:(调用如下接口,那么你就错了)
int screenWidth = Resources.getSystem().getDisplayMetrics().widthPixels; int screenHeight = Resources.getSystem().getDisplayMetrics().heightPixels; WallpaperManager.getInstance(BaseApplication.getContext()).suggestDesiredDimensions((int) ((float)1280 /screenWidth * 1280), (int) ((float)720 / screenHeight * 720));
因为,你只需要设置壁纸的内容就可以了。
mWallpaperManager.setBitmap(bitmap);
【为什么呢?】
因为不同的平台,系统默认的底层设置的分辨不同。开始系统设置的分辨率,是底层调好了的,也就是支持满屏的。但是,如果上层运用API去手动
设置壁纸的大小,并且壁纸的内容,那么,和底层的规则不一样,在开机的时候,出现短暂的闪黑屏的问题。
读者不信,可以在目录:/data/system/user/0/ 目录下,找相关的壁纸的配置文件(wallpaper_info.xml)