public HeavyLifter(Context context, Handler callback) {
this.context = context;
this.callback = callback;
this.manager = (WallpaperManager) context.getSystemService(Context.WALLPAPER_SERVICE);
}
错误:对 WALLPAPER_SERVICE 的 WallpaperManager 进行可疑转换:
预期的壁纸服务 [ServiceCast] this.manager =
(壁纸管理器)
context.getSystemService(Context.WALLPAPER_SERVICE);
我该如何解决这个问题?
您应该使用getInstance()
的方法WallpaperManager
获取一个实例。
更改以下内容:
this.manager = (WallpaperManager) context.getSystemService(Context.WALLPAPER_SERVICE);
To this:
this.manager = WallpaperManager.getInstance(context);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)