I have two service, Service A and Service B.How to develop Service B depend on a Service A? When I start Service B,I should know if Service A is running.If Service A is running,start Service B .Else,not start Service B.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
So, you question is same with, how to know one service is running or not, right 😉
Android has
Activity Managerto do your work.Th String service should be your class name, for example :
com.app.IntentAnd this is a pseudocode. I don’t make it detail because many ways to start your service, depend on how you use it.
Hope this help you 🙂