I have a background service BGService , it displays an Activity BGServActivity when certain event occurs. I have override onBackPressed to finish the displayed Activity BGServActivity.
Suppose, UI of Application App_XYZ is currently displaying. And my service BGService is triggered by the event and BGServActivity is displayed. And When i press back it closes the current Activity BGServActivity and displays the previous UI from Application App_XYZ .
But i want the UI from App_XYZ to be sent to background when i start BGServActivity from my BGService.
My question is
Is there any special flag or something that i can do to send the previously displaying UI from another activity to sent to background before starting My BGServActivity from My service BGService.
If you want to force the user to go to the Home screen when your Activity closes, you can do this:
I advise against this though. The standard behavior when closing an activity should be to return to the previously viewed activity.