As I said, the layout I have is the following
screen1 > screen2 > screen3,
if I use the close screen block the screen will change to screen2, my goal is that it changes directly to screen1.
Even if it works, Taifun is right
- It's not advisable to switch windows without closing the others; Memory and Security as main factors, then we could talk about other inconveniences
Rsad the tutorial
Use the manager screem method
and you will understand, that screen1 is the manager and closing another screen will bring you back to the manager screen
Taifun
Understood, thank you very much!
I will study this subject further, thank you very much!
Thank you!
If Screen1 is actually closed, yes. Otherwise "Open another screen" will open another instance of Screen1, so there will be two Screen1s in the App's allocated memory. Also, if leaving a Screen, it is best to stop any Clock Timers that are on it.
A procedure cannot be named "procedure".
Have you considered using Virtual Screens? They a much better solution for multi-screen Apps.
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".
Tip: Define your Clock Timers in the Blocks (Screen Initialize). Easier to tweak when working on your code and less likely to be forgotten.
But I wanted screen1 to always be open. What are you telling me is that whenever I use this procedure screen1 will be duplicated? Is there any way for me to keep screen1 always working without duplicating it? And yes, I've thought about virtual screens, but I think it would be more complicated for what I want to do.
I had already done that.
That only enables it - what about Timer Always Fires (which is mostly intended for games that are kept running when off screen) and Timer Interval?
But I don't understand what I would need this for?
The blocks above will close the current screen and go to screen1, which is already running, and that's what I want
If Screen1 is already running, and you use
"open another screen" you are creating an additional Screen 1 - that is not desirable because eventually the allocated memory could be exceeded and the App will crash.
There are several methods to switch screens
The manager screen method keeps Screen1 always open
Unfortunately you did not follow the previously mentioned tutorial
Taifun
Please explain to me what you don't understand or what you think is unclear about my guide. I actually thought - and still think - that it was/is crystal clear.
Otherwise I will definitely improve it (but I don't know how yet).
I also think your guide is very good, it's just that in my app I have several screens and there are two or three that I wanted to do different things, that's all. But I'm already working with your guide, thank you.