tags:

views:

113

answers:

1

Hi, i have a question about Services in Android. I have a application with two Services A and B. Is it 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?

+1  A: 

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));
Nikola Smiljanić
Thank you, it was easier than i thought :) It works. Inside Service A i can stop now Service B.
Norman C.