I came to know that if a service running already, next time it won't to go to oncreate, How to run two services at a time, paralley?, I want all the steps to be excecuted for both services I run.
Asked
Active
Viewed 74 times
0
-
1Possible duplicate of [Running multiple AsyncTasks at the same time -- not possible?](http://stackoverflow.com/questions/4068984/running-multiple-asynctasks-at-the-same-time-not-possible) – vaindil Mar 15 '16 at 13:26
-
I don't really understand what you would like to do? Be more specific please – suns9 Mar 16 '16 at 08:41
-
I have a service which retrieves profile data from server based on user name, Consider I want to load two persons profile data when app starts, here when I am calling one after another, only one is excecuting – Sanyasirao Mopada Mar 16 '16 at 09:16
1 Answers
0
A Service has its own life cycle. This means if you want to start the same service twice you have to start it, destroy it then recreate it (BAD implementation!!)
You have several API in the android framework allowing you to get data asynchrounously (Asynctask, Intentservice....). I think you should have a look on these ones(one of them should be more appropriate in your case)
Notice service must be your last choice because you have to manage its lifecycle. For example when your app is destroy you must manually stop your service. Otherwise it will always be running

suns9
- 875
- 2
- 8
- 17