keeplive
keeplive copied to clipboard
保活组件
java.lang.NullPointerException Attempt to invoke interface method 'void android.app.job.IJobScheduler.cancel(int)' on a null object reference com.fanjun.keeplive.service.JobHandlerService.onStartCommand(JobHandlerService.java:34)
Not allowed to start service Intent { cmp=com.fanjun.keeplive.service.LocalService }: app is in background uid UidRecord{2841d0c u0a143 SVC bg:+1m0s88ms idle change:idle procs:2 seq(0,0,0)}
在8.0上还是会有这个错误出现,请问要怎么处理呢
建议NotificationUtils中的NotificationChannel设置的等级暴露出来设置,刚集成使用发现前台服务的notification有弹出动作,可能会影响用户体验,若设为IMPORTANCE_LOW,则无弹出感,建议在ForegroundNotification的构造方法中可选传入channel的优先等级
大神,自己退出app的时候需要关闭保护服务,登录的时候启动 求一个关闭保活服务的api
我看有些地方判断这个变量非空才startForeground, 但这个静态变量,会因为进程被杀而被回收, 之后唤醒的进程这个变量就是null了, 再之后是不是就会因为没调用startForeground崩溃了,
大神还求一条关闭保活服务的api