不明白使用 START_NOT_STICKY 时何时可以重新创建服务

Don't understand when a service can be recreated when using START_NOT_STICKY

文档说当你使用 START_NOT_STICKY:

If the system kills the service after onStartCommand() returns, do not recreate the service unless there are pending intents to deliver.

在这种情况下,未决意向是什么意思?当您使用 startService(Intent) 时,方法 onStartCommand() 会立即执行。没有任何待处理的意向。

When you use startService(Intent), the method onStartCommand() is executed immediately

不一定。 onStartCommand() 在主应用程序线程上调用。因此,它一次只会处理一个 Intent。但是,其他线程可以多次调用 startService(),而 onStartCommand() 仍在处理一个 Intent。如果发生这种情况,这些额外的启动请求将排队,并且 onStartCommand() 将依次为每个请求执行。