D Dane du Plooy Member Licensed User Oct 19, 2018 #1 Is there a way, in B4A, to tell if an object is an activity or a service (using GetType or similar)?
Erel B4X founder Staff member Licensed User Longtime User Oct 21, 2018 #2 Add to Starter service: B4X: Sub Process_Globals Public Modules As Map End Sub Sub Service_Create Modules.Initialize Modules.Put(Me, True) End Sub Add to all activities: B4X: Sub Activity_Create(FirstTime As Boolean) Starter.Modules.Put(Me, False) Now you can check with: B4X: If Starter.Modules.GetDefault(SomeObject, "Error") = True Then Log("service") Else Log("activity") End If Upvote 0
Add to Starter service: B4X: Sub Process_Globals Public Modules As Map End Sub Sub Service_Create Modules.Initialize Modules.Put(Me, True) End Sub Add to all activities: B4X: Sub Activity_Create(FirstTime As Boolean) Starter.Modules.Put(Me, False) Now you can check with: B4X: If Starter.Modules.GetDefault(SomeObject, "Error") = True Then Log("service") Else Log("activity") End If