我有时会遇到这样的例外:
然后,Context.startForegroundService()没有调用Service.startForeground() android.app.ActivityThread.main有趣的是,我不知道何时或何处调用startForegroundService的堆栈跟踪。我知道它不在我的代码中,但它可能在我正在使用的第三方库中。不幸的是,堆栈跟踪几乎毫无用处。当然,我不能可靠地复制它,那太容易了!有没有人对如何追踪源头有任何建议或想法?Fatal Ex
Fatal Exception: android.app.RemoteServiceExceptionContext.startForegroundService() did not then callService.startForeground() android.app.ActivityThread$H.handleMessage (ActivityThread.java:1874) if (Bu
在服务类中,我发布来自onCreate的前台服务通知,并从onStartCommand方法返回onStartCommand。在例外情况下,我得到了一些设备。Fatal Exception: android.app.RemoteServiceException: Context.startForegroundService() did not then callService.startForeground()
根据代码,它不应该崩溃,因为我从onCreate发布前台服务通知,并在服务onDestroy上取消该通知。我猜想,
我的应用程序将在MainActivity的onCreate中调用startForegroundService(intent)。我把startForeground(ON_SERVICE_CONNECTION_NID, notification)放在了onCreate和Service的startCommand中。Exception android.app.RemoteServiceException: Context.startForegroundService() did not then call <em
我在我的安卓服务中使用Context.startForegroundService() did not then call Service.startForeground(),但我不知道为什么会发生这种情况在从我的UI执行onStop时,或者在从UI调用onPause,然后从UI调用onStop (镜像清除通知所需的操作)时,只从通知中执行错误。关于这个错误,我所能发现的是,它应该发生在调用startForegroundService时,但不要在5秒内调用startFo
我启动了一个前台服务,它适用于Android8及更低版本;但是,它提供了适用于Android9和Android10的RemoteServiceException try {
//prevent 5 seconds Context.startForegroundService() did not then call Service.startForeg