本文介绍了Context.startForegroundService()然后未在Samsung设备上调用Service.startForeground()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Samsung设备上进行服务的后台工作遇到问题.

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)

当然,在启动服务后,我会调用Service.startForeground(),而在其他设备上没有问题,仅三星设备就没有问题.

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?

我在Zopim SDK https://chat.zendesk.com/hc/en-us/community/posts/360004395368-Crash-on-Android-8-in-Android-SDK- 1-4-2

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

推荐答案

已在1.4.4中修复

https://developer.zendesk .com/embeddables/docs/android-chat-sdk/releasenotes#version-1.4.4

这篇关于Context.startForegroundService()然后未在Samsung设备上调用Service.startForeground()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-19 00:01
查看更多