I manage an ONGOING notification from my application (not from a service).
When I kill application from task manager with \"End\" button, no
The question is old but it may help others.
As pointed by others, you can use onTaskRemoved() but it is not called on many devices like Xiaomi, Oppo and other Chinese manufacturers', unless the app is added to whitelist.
To support these devices too, service can be started in foreground. This way, notification is attached to the service. So, the notification will be cleared when the service is killed (by swipping in the multitask panel).