public HeavyLifter(Context context, Handler callback) {
this.context = context;
this.callback = callback;
this.manager = (WallpaperManager) context.getSystemService(Context.WALLPAPER_SERVICE);
}
错误:可疑转换为WallpaperManager获取WALLPAPER_SERVICE: 预期WallpaperService [ServiceCast] this.manager = (WallpaperManager) context.getSystemService(Context.WALLPAPER_SERVICE);
我该如何解决这个问题?
答案 0 :(得分:0)
您应该使用getInstance()
的{{1}}方法来获取实例。
更改以下内容:
WallpaperManager
对此:
this.manager = (WallpaperManager) context.getSystemService(Context.WALLPAPER_SERVICE);