I think im not clear at all, i do want the service to persist even if the main activity is destroyed via user action or android system does it, it does it well, but when the app
First of all start a service in START_NOT_STICKY.
Override this method in your Service
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return START_NOT_STICKY;
}
and add this in your MainActivity.class
@override
private onDestroy() {
stopService(YourActiveService);
finishAffinity();
super.onDestroy()
}