Debugger disappears

Spacewalker

Member
Licensed User
Longtime User
Hello,

when I select "debug" in the IDE and run my program then I see the Debug module at the bottom of the screen.
That's OK.

But after some seconds the debugger disconnects.

I have found that the reason is an "ExitApplication" statement that I have in main.Activity_resume
If I remove "ExitApplication" then the debugger runs fine.


What I dont understand is, why my programm continues to run in the emulator even though Main.Activity_resume and "ExitApplication" is executed


Here is the log:

01/13/2013 10:44:57 : Main.Activity_Create start
01/13/2013 10:44:57 : start Activity SelectLanguage....
01/13/2013 10:44:57 : Back in Activity main.
** Activity (main) Resume **
01/13/2013 10:44:57 : Main.Activity_resume start
01/13/2013 10:44:57 :
01/13/2013 10:44:57 : Main.Activity_resume : --> EXIT APPLICATION
** Activity (act_SelectLanguage) Create, isFirst = true **
** Activity (act_SelectLanguage) Resume **


So "Main.Activity_resume" is executed and thus ExitApplication is executed.
But: my app is still runing the emulator...and I can not use the debbuger.


I use B4A V. 2.30

Heinz
 

Spacewalker

Member
Licensed User
Longtime User
If the uUser press the Back-Button and returns from another activity to the main activity then I assume that the user wants to quit the program..so I call ExitApplication
 
Upvote 0

Spacewalker

Member
Licensed User
Longtime User
OK, I will try that.

But why does my program continue to run in the emulator even after ExitApplication was executed?
(The Debugger is disconnected but the program still runs)
 
Upvote 0

Spacewalker

Member
Licensed User
Longtime User
thank you for the information.

If I use "main.activity.finish" I have problems to run the app again...maybe I know the reason:

I have many activities.. must I close all activities, or is it enough to just close the main activity?

If I must close all activities, is there a way to close all open activities with one command?
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
In my opinion, the proper way of handling activities is to close them using activity.finish every time you exit one of them. This way, you will never have to worry about having left an open activity.
If for some reasons you need to keep activities open, all the way long, you could use a boolean flag in order to tell each one of them to finish when you choose so. Still, I wouldn't advice doing so from my experience with such coding.
 
Upvote 0

Spacewalker

Member
Licensed User
Longtime User
OK, thank you..so if closing all activities is the proper way then I will try it.

Would be nice though if there was a command that closes all open activities...maybe worth a feature request :)

Basically all I want to do is to quit my app gracefully when the back-key is pressed in the main activity.
 
Upvote 0
Top