Block close screen

How do I place the close screen block when I finish designing a screen? Where should it be placed? For example, I want to make a simple logic: when you press the button “go” opening screen 2 and closes screen 1. But I can’t place the close screen block under open another screen, so how do I do it? Thanks.

You can’t directly place Close Screen right under Open Another Screen, because when Kodular executes it, the app will close the current screen immediately before it even finishes opening the new one.

:backhand_index_pointing_right: The correct way is,

  • On Screen1, just use Open Another Screen with the name of the next screen (e.g. “Screen2”). Don’t add Close Screen here.

  • Then, inside Screen2.Initialize, add a block like:

    Close Screen With Value “close”
    

    or use Close Screen in the new screen when you want to go back.

If your goal is simply to move from Screen1 → Screen2 and never come back, you need Close Application from screen2.

My recommendations use Close application block instead of closing screen1 manually

blocks (25)
This will close the app without going back to screen1

Kodular automatically pauses the previous screen when the new one opens.

but I don’t have to close the application because in reality there are 5 screens so after screen2 there would be screen3 etc. I just wanted to understand how to close the screens after switching to a new one to save memory

1 Like

I said

This means that once you navigate to another screen, there won’t be any ongoing processes from the previous one — unless you’re using special tools like iTools or similar. The app definitely won’t keep consuming memory in the background.

Edited: If you experience any lag, it depends on the screen you navigated to, not the one you left.

Taifun

1 Like