Service stopping another Service
i have a question about Services in Android. I have a application with two Services A and B. Is it开发者_如何学C possible that Service A can stop Service B? I dont want to do it through a Activity, cause the Application will be in Background. If some special Event happen in Service A, then it should tell Service B to stop. How can i do that?
You may need some other way to obtain an object of SeriviceA but this is the basic idea. Services are Contexts just like Activities are.
stopService(new Intent(ServiceA.this, ServiceB.class));
精彩评论