Timer not working

Understood, thank you very much!

1 Like

I will study this subject further, thank you very much!

1 Like
2 Likes

Thank you!


Is this right?


This way it is shorter and works the same way i need.

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".

2 Likes

Tip: Define your Clock Timers in the Blocks (Screen Initialize). Easier to tweak when working on your code and less likely to be forgotten.

2 Likes

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.

imagem
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?

Snap3

2 Likes

But I don't understand what I would need this for?
imagem
The blocks above will close the current screen and go to screen1, which is already running, and that's what I want

1 Like

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.

1 Like

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

1 Like

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). :wink:

3 Likes

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.

What does that have to do with my guide? Or to put it another way, it doesn't matter what you do on the different screens, it doesn't change the fact that there are exactly two (and only two) ways to switch screens.

3 Likes

Maybe quantum stuffs :man_shrugging:

@tostas

  • Es: Igualmente deberías utilizar otro acercamiento, como el de los arreglos (Layouts); vertical, horizontal, rejilla, y scroll. Lo digo por el uso del Timer.

  • En: You should also use another approach, such as Layouts; vertical, horizontal, grid, and scroll. I say this because of the use of the Timer.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.