{"action":"created","issue":{"url":"https://api.github.com/repos/JoanZapata/android-asyncservice/issues/15","labels_url":"https://api.github.com/repos/JoanZapata/android-asyncservice/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/JoanZapata/android-asyncservice/issues/15/comments","events_url":"https://api.github.com/repos/JoanZapata/android-asyncservice/issues/15/events","html_url":"https://github.com/JoanZapata/android-asyncservice/issues/15","id":103277704,"number":15,"title":"how would you cancel the current running service?","user":{"login":"k0shk0sh","id":960767,"avatar_url":"https://avatars.githubusercontent.com/u/960767?v=3","gravatar_id":"","url":"https://api.github.com/users/k0shk0sh","html_url":"https://github.com/k0shk0sh","followers_url":"https://api.github.com/users/k0shk0sh/followers","following_url":"https://api.github.com/users/k0shk0sh/following{/other_user}","gists_url":"https://api.github.com/users/k0shk0sh/gists{/gist_id}","starred_url":"https://api.github.com/users/k0shk0sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k0shk0sh/subscriptions","organizations_url":"https://api.github.com/users/k0shk0sh/orgs","repos_url":"https://api.github.com/users/k0shk0sh/repos","events_url":"https://api.github.com/users/k0shk0sh/events{/privacy}","received_events_url":"https://api.github.com/users/k0shk0sh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JoanZapata/android-asyncservice/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-26T14:03:14Z","updated_at":"2015-08-27T06:10:41Z","closed_at":null,"body":"i have tried almost everything to stop the current task, but it doesn't stop. is there any way to stop current running service?"},"comment":{"url":"https://api.github.com/repos/JoanZapata/android-asyncservice/issues/comments/135303999","html_url":"https://github.com/JoanZapata/android-asyncservice/issues/15#issuecomment-135303999","issue_url":"https://api.github.com/repos/JoanZapata/android-asyncservice/issues/15","id":135303999,"user":{"login":"JoanZapata","id":675408,"avatar_url":"https://avatars.githubusercontent.com/u/675408?v=3","gravatar_id":"","url":"https://api.github.com/users/JoanZapata","html_url":"https://github.com/JoanZapata","followers_url":"https://api.github.com/users/JoanZapata/followers","following_url":"https://api.github.com/users/JoanZapata/following{/other_user}","gists_url":"https://api.github.com/users/JoanZapata/gists{/gist_id}","starred_url":"https://api.github.com/users/JoanZapata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoanZapata/subscriptions","organizations_url":"https://api.github.com/users/JoanZapata/orgs","repos_url":"https://api.github.com/users/JoanZapata/repos","events_url":"https://api.github.com/users/JoanZapata/events{/privacy}","received_events_url":"https://api.github.com/users/JoanZapata/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T06:10:41Z","updated_at":"2015-08-27T06:10:41Z","body":"Let's say you have this method in you service:\r\n\r\n```\r\n@Serial(\"Test\")\r\npublic void getSomething(){\r\n    // ... Long running op\r\n}\r\n```\r\n\r\nThen you can cancel any currently running operation doing:\r\n\r\n```\r\nBackgroundExecutor.cancelAll(\"Test\", true);\r\n```\r\n\r\nFields must be static because the service is instantiated for each receiver, if the field isn't static you could have different value in different service."}}