Android Question Close application

Hirogens

Active Member
Licensed User
Longtime User
Hello, when I quit my application (press android square and kill with the swip) I have a problem.
My application continu to run in background and I don't want to have this. I link a picture with the problem.
 

Attachments

  • Screenshot_20181004-144241.png
    Screenshot_20181004-144241.png
    212 KB · Views: 492

Hirogens

Active Member
Licensed User
Longtime User
And when I restart my smartphone, I have this so that's why I would like to know how to avoid that
 
Upvote 0

Edson Freire

Member
Licensed User
Longtime User
I don't know if this works, but you can use this event in your Starter service.
B4X:
Sub Service_TaskRemoved
    ExitApplication
End Sub

Edit: There's a comment: This event will be raised when the user removes the app from the recent apps list.
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
Starter is enough specific service. Personally I put a part, which needs "StartAtBoot" into separate service.
In my case the service checks, if there is a work (not sent to webserver files), and if nothing to do, stops itself.

For which purpose do you use "at boot" ?
 
Upvote 0

Hirogens

Active Member
Licensed User
Longtime User
Starter is enough specific service. Personally I put a part, which needs "StartAtBoot" into separate service.
In my case the service checks, if there is a work (not sent to webserver files), and if nothing to do, stops itself.

For which purpose do you use "at boot" ?

I only use the Starter service because I use it a little bit. But when I want to kill my application I can see that she is still runing in back ground ... And I don't want to have this. Actually, if I want to close it I need to Force stop the application ...
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
If ExitApplication doesn't work, you can try
B4X:
Dim jo As JavaObject
jo.InitializeStatic ("java.lang.System")
jo.RunMethod ("exit", Array (0))
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Upvote 0
Top