Do you know how to start a service?  you do a startService() on a context...

Stopping the service is now literally calling a stopService() on the context...

So now all you have to do is call these methods.  You might think that
you have to keep the global application state around, but this isn't
really so bad, because your app and the service are both running at
the same time (i.e., they are *not* separate processes, it's just that
what you see in an activity is what people usually think of as the
app..., the service will run within your app!)

kris

On Mon, Nov 7, 2011 at 5:31 PM, Goutom <[email protected]> wrote:
> Hi
> I have an app with one screen(just one button). I will press the button and
> the background service will start(after binding with this activity).
> Close the app.Next time when I will start the app and if I press the button
> then my previous background service will stop.
>
> How to do this?
>
> Take care.
>
> Regards
> Goutom Roy
>
> --
> 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

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