rizwan wrote: > I am looking to code simple application > > let's say I have an activity that starts a service which is simply a > counter and counter value is > reflected on activity UI , when I navigate away from this .I want this > counter to be continue > and when I get back to Activity I want to see counter count.so the > question is > > how can a reconnect with the started service and then if I want to > kill it ?
Without knowing how your counter value is getting from your Service to your Activity, it is difficult to say if you need to "reconnect" or how that might be done. To stop a service, call stopService(). > how can I know the service is already started ? You don't, generally. Your activity will probably be calling startService() to make sure the service runs (and will keep running even after the activity ends). So, whether the service was started or not, the activity will start it. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training in US: 14-18 June 2010: http://bignerdranch.com -- 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 To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.