i new here and i'm having a problem with my counter.
here's what im trying to do.
i have a activity with a button on it and and a counter variable.
When someone click on the button it increments the counter and sends the result to another activity, which then should display it on a label.
However i cannot get the counter to go from one activity to another. I made it Global.
this is the button click event
this is the label stuff i also dont no where to place the code for the label.
lblnzscores is the label i need the score to show up in.
lblnzscore is in the NewZealand activity
btntrademecheck is the button you click on for all this to happen.
btntrademecheck is in the NZtrademe activity
thanks
here's what im trying to do.
i have a activity with a button on it and and a counter variable.
When someone click on the button it increments the counter and sends the result to another activity, which then should display it on a label.
However i cannot get the counter to go from one activity to another. I made it Global.
B4X:
'Activity module
Sub Process_Globals
Dim qc As Boolean
Dim score As Int : score = 0
End Sub
Public Sub btntrademecheck_click
If txtinput.text.Contains ("trade me") Then
qc = True
score = 1
Msgbox("Correct", "This is the title")
StartActivity("NewZealand")
Else
qc = False
Msgbox("Wrong", "This is the title")
End If
End Sub
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout ("NewZealand")
lblNZscores.Text = NZtrademe.score
End Sub
lblnzscores is the label i need the score to show up in.
lblnzscore is in the NewZealand activity
btntrademecheck is the button you click on for all this to happen.
btntrademecheck is in the NZtrademe activity
thanks