Switching app between foreground and background in code


Does anybody know how to switch app between background and foreground in code?
Take screensaver, for instance, it goes background when the user taps the screen and will be re-invoked after certain period of time.

I understand the Home Button pushes away the app to background, but would like to understand if we can switch and control the app between background and foreground in code.

Many thanks in advance for your information. :slight_smile:

No, this can’t be done in code. An app in the foreground can attempt to open a different application (e.g. to view a webpage or to open Settings), but it can’t go into the background to show the home screen; similarly, if it’s running in the background, it can’t force itself into the foreground either.

1 Like

Thank you very much for an update.
No wonder I can’t find any specific information… :sob::sob::sob: