In my case, I receive a notification message and open an Activity say 'X'. After closing it I want to bring my application again to foreground like the behavior of the Application launcher.
In more details I want to see if my app in the background, bring it to foreground. If not, restart it. Any suggestions, please?
You can use getRunningAppProcesses() in ActivityManager. And then check your package name in the list of running Processes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With