Android Question Global variables - approch

gyruss68

Member
Licensed User
Longtime User
Hi,
I read that the starter service is the place to enter the global variables of the project.
I can not understand why sometimes I lose the variables from the starter service.
What's the service life cycle?

Is correct this approch ?
ActivityA - declare in the Process_Globals a variable X
assign a value to X = 1
ActivityA.finish
StartActivity (B)
Activity B - log (X)

Thank's
Franco
 

mangojack

Expert
Licensed User
Longtime User
In Starter Service Process Globals declare your variable ..
B4X:
Public myVar As Int

Then in activity A ...
B4X:
Starter.myVar = 1

Activity B ...
B4X:
Log(Starter.myVar)
 
Upvote 0
Top