首页 > 解决方案 > Context.startForegroundService() 没有在 Vivo 所有具有 8.0 版操作系统的模型上调用 Service.startForeground()

问题描述

仅在使用 onCreate/OnStartCommand 中的通知通道进行所有必要的建议更改后,才会在所有 Vivo 模型上崩溃

 Fatal Exception: android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground()
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:192)
       at android.app.ActivityThread.main(ActivityThread.java:6671)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)

       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:818)

> Blockquote

标签: remoteserviceexception

解决方案


推荐阅读