How do I count the time of opening a particular screen?

Hi, I'm making a expense tracking app, with income recording function. The screen 2 of the app is used for entering the users' income. However, I consider that it would be so annoying for the users to enter their income everytime they use the app. So I want the user only have to enter their income for the first time they go to screen 2, and for the reset of the time the app will skip screen 2 automatically and go to screen 3 (there will be a button for them to update their income).

Now, the problem is that I don't know how to show screen 2 only once when the user open the app for the first time only. I think there have to be a count the time of opening a screen function, but I don't know how to do it.:frowning:

Please help

1 Like

grafik

Thank you! :smiley: I'll try. But where should I put these blocks in? Screen 2? And do I have to use "when screen 2. Initialize"?

1 Like

Yes, but what about trying ...?

If you use this (firstRun) block on Screen2 you should close Screen2 when opening another screen (Screen3):

grafik

I've tried to add your blocks to screen 2 with and without "when screen 2. Initialize" in the AI Companion for several times already. When I didn't add the "when screen 2. Initialize" block, screen 2 didn't change to screen 3 when I go to screen 2 for the second time. When I did add the "when screen 2. Initialize" block, the app skip screen 2 and go to screen 3 directly. I'm so confused :confused: .
2022-06-03

*update: Screen 2 have already used a tinyDB to store the income of the user. Would this affects your blocks?

Screen1 - Screen2 - Screen3:

So that you can also test it with Companion.

The APK also allows you to just close Screen3 to return to Screen1.

1 Like

Thanks a lot! I did it finally :joy: