Close all screen, but Screen1

Hello everyone!
I am building an app that Screen1 opens Screen2 and then Screen2 opens Screen3, and Screen3 opens Screen4.
What I want to know is: Can I close all screens, but Screen1 (which is my menu), from my Screen4?
I don't want to close the screens right after I open another, I just want to simply close all screens but Screen1 in a certain moment on Screen4 and reopen Screen1 without inicializating it, because it's already open.
Thanks for the help :wink:

Hello Gabriel

You can't do that with Screens, they are in separately allocated memory. You can however do that with Virtual Screens.

When we define virtual screens, we use one 'real' App Inventor Screen (most often Screen1). Screen-sized Vertical Arrangements on it are displayed/hidden as required - they are the Virtual Screens. This is generally a better approach for multi-screen Apps, they share data without having to "pass" it between screens and it also reduces code duplication, making the App more efficient and the code easier to follow if you have to return to it at a later date.
So, instead of separate "houses", virtual screens are "rooms" of the same "house".

2 Likes

This is not the case, by anyhow you jump to Screen is will be initialized first, just is happen when you open it very first tiome.

No, you can't refrence a screen while being at different screen. It is always recommended to follow this way to calling different screens only.

Finally, ultimate solution is

1 Like

Something like this?
(I set the TimeInterval to 3000 (3 sec) to better illustrate.)