I have FooListActivity (one instance, showing a list of all the foos) and FooActivity (zero or one instance per foo).

FooActivities can be started from the FooListActivity, but also from a long-running service with no user intervention.

How can I make sure that, at most, one FooActivity exists per foo?

i.e. If I try to start a FooActivity for a foo which already has a FooActivity, it should bring the existing FooActivity to the front, rather than creating an unneeded instance.