When screen1 opens say, Screen2 and the Screen2 is closed where does Screen1 program pointer is?

I would like to know what happens to the environment variables of Screen1 when control is returned to it from another Screen.
When I run Test/Connect to Companion my impression is that, in the scenario above, Screen1 restarts.
But When I Export the .apk and install in my smartphone my impression is that something else takes place as I have to restart the Apps to make it behave as I expected.
Assistance welcome.

see here App Inventor Tutorials and Examples: Manager Screen | Pura Vida Apps


Ok, thanks, I saw the links. It matches the behavior I am experiencing.
In fact Companion run causes Screen1 to restart when control returns to it but not the .apk
As it is normal behavior I will find ways to deal with it.