You don't have to do anything special to keep the service in the
background when you exit your activity.  When you exit your activity,
your service is still running in the background until you call
stopService, the phone sleeps (which pauses your service), or the
phone removes the service.

So, just exit your activity normally or call finish() from within your
activity.

Of course, you need to set up intents to communicate to the service,
or bind your activity to it when the activity starts.  But, that's
another topic alltogether.

Read the section on process lifecycle and the developers guide on
activities as well as services.

Richard Schilling
Root Wireless




On Jul 22, 4:38 am, Pritam <pritampat...@gmail.com> wrote:
> Hi,
>
> I have one Activity, that starts one Service and my service will lunch
> one Activity, i wanna to stop the Activity which one started my my
> Service after few seconds.
> Is there any way to achieve. Has anyone experienced this type of
> scenario.
>
> --
> Regards
> Pritam
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to