Re: [android-developers] Cant stop service

2011-06-21 Thread Boozel
Thanks very much for the help, that did it. -- 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] Cant stop service

2011-06-20 Thread Boozel
Hi I have a toggle button which i use to start and stop a service When i press the button the service starts fine but i cant seem to stop it. The boolean a in my code below return true but the service keeps running. What am i doing wrong? any help would be great. Thanks in advance toggle =

Re: [android-developers] Cant stop service

2011-06-20 Thread Kostya Vasilyev
Do you have any code that binds to this service? 2011/6/20 Boozel boozelcl...@gmail.com Hi I have a toggle button which i use to start and stop a service When i press the button the service starts fine but i cant seem to stop it. The boolean a in my code below return true but the service

Re: [android-developers] Cant stop service

2011-06-20 Thread Boozel
No, i need the service to run independently from the activity -- 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

Re: [android-developers] Cant stop service

2011-06-20 Thread Kostya Vasilyev
Ok. Your code calls startService and stopService with different Intent objects: toggleIntent vs. toggleMapIntent. Does the stop intent actually point to the service you want to stop? If not, you are stopping someone else's service. -- Kostya 2011/6/20 Boozel boozelcl...@gmail.com No, i need

Re: [android-developers] Cant stop service

2011-06-20 Thread Boozel
sorry i changed the variable names to make it more readable they are actually both the same intent toggleIntent declared above. Could it be because the intent would essentially be redeclared each time the button is pressed with the line Intent toggleIntent = new Intent(MyActivity.this,

Re: [android-developers] Cant stop service

2011-06-20 Thread Boozel
Changing that doesnt seem to help? Any ideas? -- 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

Re: [android-developers] Cant stop service

2011-06-20 Thread Kostya Vasilyev
How are you checking for whether the service gets stopped? 2011/6/20 Boozel boozelcl...@gmail.com Changing that doesnt seem to help? Any ideas? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to

Re: [android-developers] Cant stop service

2011-06-20 Thread Boozel
The service continues to write to the log -- 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

Re: [android-developers] Cant stop service

2011-06-20 Thread Kostya Vasilyev
Does the service's onDestroy ever get called? 2011/6/21 Boozel boozelcl...@gmail.com The service continues to write to the log -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to

Re: [android-developers] Cant stop service

2011-06-20 Thread Dianne Hackborn
You are responsible for stopping whatever work your service does in its onDestroy(). You can look at the current state of all actively running services with adb shell dumpsys activity services. Make sure your service is actually in there. If it isn't, you aren't cleaning up your worker. On