The object of this exercise is to use SubDelayed2 in Activity2 to display a value in MAIN activity. But the value returned is blank. I can move the sub to Main and get the value I want, but that will defeat the purpose of the exercise.
Is there any way to modify my code and stick with SubDelayed2 to display the correct value?
Thank you
'MAIN activity:
'Activity2:
Is there any way to modify my code and stick with SubDelayed2 to display the correct value?
Thank you
'MAIN activity:
B4X:
Sub Process_Globals
Dim MyTeam As String
End Sub
Sub Activity_Create(FirstTime As Boolean)
StartActivity(Activity2)
End Sub
Sub GetTeam(s As String) As String
MyTeam= "My favorite soccer team is located in " & s
End Sub
'Activity2:
B4X:
Sub Activity_Create(FirstTime As Boolean)
CallSubDelayed2(Main,"GetTeam","France")
Log("My Team is: " & Main.MyTeam) 'Displays a blank value, Why???
End Sub