Context.startForegroundService() did not then call Service.startForeground() on Samsung devices

痴心易碎 提交于 2019-12-13 11:41:11

问题


I have an issue with background working of service on Samsung devices.

Fatal Exception: android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground()
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1881)
       at android.os.Handler.dispatchMessage(Handler.java:105)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6938)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

Of course, after starting the service I call Service.startForeground() and there are no problems on other devices just only Samsung device.

Is anybody know the reason and how to work around of this issue?

I have found similar problem in Zopim SDK https://chat.zendesk.com/hc/en-us/community/posts/360004395368-Crash-on-Android-8-in-Android-SDK-1-4-2

来源:https://stackoverflow.com/questions/55653373/context-startforegroundservice-did-not-then-call-service-startforeground-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!