Android Question Event Activity Close

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
Hello,
I use this code to Exit from application:

If KeyCode = KeyCodes.KEYCODE_BACK Then
R = Msgbox2 ( "Uscire dall'applicazione?" , "Attenzione" , "Yes" , "" , "No" , Null )
If R = DialogResponse.NEGATIVE Then
Return True
Else
ExitApplication
End If
End If

After this event, does it exist any other event such as "Activity_close"?
Because I need to exec a SQL in Web Service, and if put this SQL before "ExitApplication", it isn't successful execute because it don't have the necessary time to act.
 

NJDude

Expert
Licensed User
Longtime User
That's how Android works, eventually the OS will kill the process, memory management is done by the OS, if you use ExitApplication, you are stopping all processes, which means, that if you have a service running in the background it will also be killed.
 
Upvote 0

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
That's how Android works, eventually the OS will kill the process, memory management is done by the OS, if you use ExitApplication, you are stopping all processes, which means, that if you have a service running in the background it will also be killed.

But I WANT to kill all the processes. I only need to execute a SQL procedure before the application end or the tablet is turned off
 
Upvote 0

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
Then you will have to a find a way to do what you want, you will have to make sure the SQL part has completed before killing the process.

So, I'm asking HOW to do that o_O
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
I don't know, I have no idea what you're doing and how, but if you want a clue I have already told you what to do in my previous post, make sure your SQL procedure finishes, then exit the app.
 
Upvote 0

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
I don't know, I have no idea what you're doing and how, but if you want a clue I have already told you what do in my previous post, make sure your SQL procedure finishes, then exit the app.

Ice cream! :)
 
Upvote 0
Top