Android Question Call a sub in a class defined in starter service.

davemorris

Active Member
Licensed User
Hi Guys

Up to this point in B4A, I have always used the classic CallSubDelayed()/CallSub() as appropriate to call subs in Activities or Services. However, by mistake I called a sub (defined within a class) in the Starter service using the classic OOPs format Starter.objectName.subName - and it appeared to work. Any comments.

Assume I create a class
B4X:
XXXclass
   :
public sub XXXsub
  ' Does some work
end sub
Then create an object in the starter service based on this class
B4X:
Starter Service

public XXXobj as XXXclass
Then in my case I called the sub from the main activity (and it appeared to work in debug)
B4X:
Main Activity
 ' Some code
Starter.XXXobj.XXXsub
Thanks in advance, its all for my on-going attempts make my code more X-platform (B4A/B4I) friendly.

Kind regards
Dave
 
Top