perhaps a static int variable of the number of active instances that
is incremented in on create and decremented in ondestroy?

On Nov 30, 12:43 pm, "[email protected]"
<[email protected]> wrote:
> I have an Activity which is launched from a Service. This Activity can
> spawn other children Activities.
>
> Now under certain conditions (particularly related to using screen
> lock), I can end up with the Service starting a second copy of the
> Activity again.
>
> For reasons of performance, the Service is being started and stopped
> at various times, and cannot be relied on to hold state.
>
> What is the best way to prevent this second launch?
> Can I (for example) detect that the Activity is already running in the
> stack and do finish()?
>
> This feels like it should be straight forward - perhaps I'm being
> thick - forgive me.
>
> Thanks for any help
>
> Ian Hunter

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