Problem exiting the application.

I have made a three window application. All the windows I have made a button that when pressed exits the application. But this does not happen.

When I press this button another window opens. And when I press a second time, it does exit the app. Any solution?
I have made other apps and this is the first time this has happened.

Most probably you are not switching screens correctly. See how to


The recommended method of switching screens in App Inventor

Tribblehunter's Multiple Screen Method

(this is the method, @dora_paz was suggesting)



The important piece of information here is that Screen1 is considered the initial screen of your application. The close application block closes screens until it reaches Screen1, at which point it closes Screen1. If you ever open a second copy of Screen1, you end up in a situation where App Inventor expects that it has closed the application but in fact it hasn't due to the copy of Screen1 in the activity stack. Make sure in your app design you never open more than one copy of Screen1 and the problem goes away. The examples presented here ensure that only one copy of Screen1 exists at any point in time, but it's important to ensure that the user experience makes sense for your app.

1 Like

Thank you very much everyone for the help.
I think the one that is right is "ewpatton". It's true. In my app I open more than one copy of the main screen "Screen1"

In addition, the help of the other colleagues (taifun and Dora_paz) also helps me. I was unaware of those methods to close screens and applications.
I will try and comment.
Thanks again

@dora_paz and @Taifun indicate the same thing.

1 Like