Ai Companion closing every time I try to change to a certain screen

Here is my code:
Screenshot 2022-10-25 2.50.54 PM
Anything wrong?

How did you open this screen ? and what it did after open Screen1?

Show your relevant blocks.

So, I pressed a button on the ai companion and the ai companion closed, the code (shown above) was the only code on the blocks screen.

Can you see the screenshots? If you can't, my bad.

Yes . How to switch screens correctly see here

Taifun

Sorry, I can't test my app right now, I have low wifi. Also, a question. When does this code run?
Screenshot 2022-10-25 8.17.59 PM
Is there a specific button I press to get it to run the code? I am a little confused.

.BackPressed listens for the back button on your
navigation bar.
On pressing said button, the method is called.

I didn't know that, I will try that.