On Apr 6, 2:52 pm, "Mark Murphy" <[email protected]> wrote:
> > Sorry for the newbie question, but does anyone know how I can check
> > whether an IntentService is already running?
>
> > I'm starting an IntentService from onCreate within a normal Activity,
> > and that means that if the user minimises and maximises the
> > application, it gets called twice.
>
> Android does not have a "minimize" or "maximize" the application.

Yes, sorry, I was being metaphorical...

> If you mean the user presses the HOME key, then that will only cause
> onCreate() of your activity to be invoked again if there has been a
> substantial period of time elapsed, enough that your original activity was
> kicked out of RAM. And, in that case, you can use onSaveInstanceState() to
> persist a flag indicating whether or not  you need to re-run the
> startService() call.

OK - thanks - that sounds like what I need :)

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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to