从 android 中的服务 class 启动服务

Start a service from a service class in android

是否可以从另一个服务 class 启动服务 class?

 Intent localIntent =  new Intent("com.example.android");
                startService(localIntent);

我试过上面的代码,但我认为它行不通。

Is it possible to start a service class from another service class?

AFAIK,您可以从任何 Context.

启动服务

I have tried the above code but I do not think it works.

好吧,希望您的服务没有 <intent-filter> 的操作字符串 com.example.android。使用明确的 Intent 来标识您的服务(例如,new Intent(this, YourServiceClass.class);)。