Android墙纸服务

时间:2019-06-14 12:37:03

标签: android wallpaper

当我以前在Android 7.1.2上安装时,它可以正常工作。        但是在Samsung Android版本8.1.0上它崩溃了。        然后我稍后将代码更改如下

   Intent intent = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
               intent.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
               new ComponentName(this,LiveWallPaperService.class));
               startActivity (intent)

使用startActivity (intent)的呼叫服务在8.1.0中崩溃。        因此,我使用了startService ( intent )。        它启动一个自定义墙纸服务类(LiveWallPaperService)。        但它不会像Android 7.1.2版本那样调用WallpaperService并绘制墙纸

0 个答案:

没有答案