Android Question ExitApplication & Service

pesquera

Active Member
Licensed User
Longtime User
Hi All,
I have an App that do a StartService to Intercept sms
My question is: if I apply ExitApplication on my Main App, will also close that Service? (I want the service always on)
Thanks
 

pesquera

Active Member
Licensed User
Longtime User
Thanks Erel,
Now,
Is there a way to check if the service is off? So, I'll call StartService if needed
What happens if I StartService many times? (on Main)
Does the service starts many times? or, just don't start it because is already started
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Longtime User
To check if the service is running
B4X:
if not(isPaused(Service_Name)) then
  DoSomeThing
else
  StartService(Service_Name)
end if


And if you call StartService many times, your service will restart (it will pass the Service_Create one time but many times Service_Start)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…