If they are running in the same process, you could just use globals to keep
track of who is running and decide what next to do.

If you really just want one thing to run at a time, though, why not just put
it all in one service?  A common pattern is to have a service that you
submit work to with startService(), which does each thing given to it in
order and stops itself when done.  There is an ApiDemo showing how to
structure such a service (the one with three buttons to submit work to it, I
can't remember the exact name off-hand).

On Tue, Feb 3, 2009 at 9:12 AM, Al Sutton <[email protected]> wrote:

>
> I have an app which will start multiple separate services which perform
> an action and then exit. I don't want them all to run at the same time
> (because this may bog down the OS).
>
> I have the code for finding the services and starting the services, but
> does anyone know how I can make sure one service has completed before
> the next starts.
>
> Due to what the app does it will have to start multiple services and the
> actions the services perform have no GUI and may take tens of seconds or
> minutes (hence why I'm using a service so the user isn't just shown a
> blank screen every time the next service starts).
>
> Anyone have any ideas?
>
> Al.
>
> --
> ======
> Funky Android Limited is registered in England & Wales with the
> company number  6741909. The registered head office is Kemp House,
> 152-160 City Road, London,  EC1V 2NX, UK.
>
> The views expressed in this email are those of the author and not
> necessarily those of Funky Android Limited, it's associates, or it's
> subsidiaries.
>
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to