Android Question Using Process_Globals

Tjitte Dijkstra

Member
Licensed User
In my app I need a kind of SETUP-activity to change the language, the level etc.
To achieve this, I make a test program with 2 activities/modules.
In both I defined a Process_Global variable and I expected that the value of that variable would change after returning to the main activity, but apperently I did something wrong.
Who can show me the error? All files are in 2Screen_TD.ZIP
THIS IS THE MAIN ACTIVITY:

Sub Process_Globals
Dim XX As Int
End Sub

Sub Globals
Private button1 As Button
Private Button2 As Button
Dim XXLabel As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
XX = 1
XXLabel.Text = XX
End Sub
Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Button2_Click
StartActivity("Scherm1")
End Sub
Sub button1_Click
XXLabel.Text = XX 'I expect to see the value rise after retruning from activity Scherm1
End Sub

THIS IS THE 2ND ACTIVITY:
Sub Process_Globals
Dim XX As Int
End Sub

Sub Globals
Private button4 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
If FirstTime = True Then Activity.LoadLayout("Scherm1")
End Sub

Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)
End Sub

Sub button4_Click
XX = XX + 5
StartActivity("Main")
End Sub
 

Attachments

Top