GSP And service

tufanv

Expert
Licensed User
Longtime User
Hello,

I have an application which does NOT use service. Now i want to add my app functionality to run on back ground. I added a service to my project moved the gps codes like gps.start and locationchanged subs to service module. But for example under Sub GPS_LocationChanged (Location1 As Location) i have
lblspeed.text = location1.speed

but because service doesnt have sub globals , i cant use any labels. How can i use the main activity's labels or textboxes to change within service module. ?

TY
 

JoanRPM

Active Member
Licensed User
Longtime User
Tuvanv.

In the service module, define all the global variables you will need in the main activity. You need to define these variables in: Sub Process_Globals.
When you open the application in main activity, you just have to catch them:

var_main = service_name.lblspeed.text (service_name is the name of the service module).

Greetings.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
The problem is i can not run what i want in service module. Everything is included in activity side but when i move the code to service side, the lables and other things identified in main activity does not run in service module ( it says for example label1 is not defined )
 
Upvote 0
Top