A simple call to
Intent serviceIntent = new Intent(this, NotificationService.class);
startService(serviceIntent);
is bringing the app to front if it's in the background, nothing happens if the app were closed. I want to avoid this behavior but, i do not know how to do it.
It happened on android O and P.
I've setted up the alarmManagerto wake up my app at specific time, then a pendingIntent starts an Activity (it does not show anything in the screen) and it checks the received action from the Intent to determine the action to be performed. I have 2 Services in my app and both of them bring app to front everytime they're waked up, this is annoying to user.