hi, Thats not my doubt. My service needs to read some data using htttpget, this action is performed onStart method of the service. While service is in middle of reading data from web. If someone starts the service again. What happens to the task started first? Will the service ends the first task and starts again from onStart function or Will service run the two task in separate two threads?
-Sukumar. On Dec 18, 12:08 pm, JP <[email protected]> wrote: > Here's my 2 cents on Services: I personally do not execute anything > inside a service. A Service runs in the main Thread of the hosting > process, so any real "work" would interfere with the user experience. > I use Service however to provide isolation from the main Activity, and > start Threads that cover all the background work in the overridden > onStart() method. From that point on you can manage Threads like you > normally would. Note that these Threads live irrespective of the > application life cycle. This is cool, because it can cut down on app > startup time once established. Adds complexity though! > > On Dec 17, 10:08 pm,sukumar<[email protected]> wrote: > > > > > hi, > > > Need some info on working of service on Android. If a service is > > launched from an App and the serivice is in middle of execution and > > again the same serivice is started from the App. Will the service > > started first will end and service started latter will execute? or the > > service runs in two different thread? > > > Thanks, > >Sukumar.- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

