I have a background service in which I want to show a notification which allows the user to stop it.
In the android SDK docs it says an activity is used to normally launch an Activity. So I am wondering if I need to create an activity to stop the service or can I directly stop the service when user selects the notification,
So how would the intend call back the service to stop it..
Thanks,
You cannot directly stop the service from a
Notification. You can start the service, using anIntentthat has an action string or extra or something that the service sees inonStartCommand()and triggers it to callstopSelf().