Bug? Wrong start of service

Sgardy

Member
Licensed User
Longtime User
Do anyone can help me to solve this strange problem?
The prolem is present only when the service is loading at boot.

I have a service doing something like this:

Dim Ok as boolean
Sub Service_Start (StartingIntent As Intent)
CheckSettings
Controller​
End Sub

Sub CheckSettings
If 1 = 1 then Ok = true​
End Sub

Sub Controller
If Ok then
StartService(A)​
Else
StartService(B)​
End If​
End Sub

The problem is that the services A or B are launched, I can see them in the applications list but they doesn't works, even IsPaused returns True, in the activity I must call CallSub(Starter,"Controller") twice an then they works, the last solution, that I don't like indeed, is the following:

Sub Controller
If Ok then
StopService(A)
StartService(A)​
Else
StopService(B)
StartService(B)​
End If​
End Sub

In this case everything goes fine.

I tried also to put all in a service different instead of Starter but it's all the same, the service Starter is loading at boot in foreground, the other two not.

Many thanks in advance.
 

Sgardy

Member
Licensed User
Longtime User
Thank you Erel and sorry about the code... Service Starter can be sticky and foreground? Tnx
 

Sgardy

Member
Licensed User
Longtime User
It can be foregound but not sticky.

The starter service should never be the explicit entry point. It is inserted before the defined entry point.

SOLVED!
Thank you Erel, the problem was Starter loading at boot and Sticky, now I've moved the loading at boot job in another service and it's perfect!
Ciao
 

Sgardy

Member
Licensed User
Longtime User
I just suggest to add an alert for that in the IDE ;)
 
Top