Hello,
I am a newbie with Basic4Android i am trying the following:
I have a Game class which holds the game info:
Then i have main from which loads the class the the players form
But if i call frmPlayers the class i don't see the Msgbox
I only want to load the players once and 'share' the Main.Game between activities.
I hope i makes sense.
Thanks in advance.
I am a newbie with Basic4Android i am trying the following:
I have a Game class which holds the game info:
B4X:
Type=Class
Version=3
@EndOfDesignText@
'Class module
Sub Class_Globals
CurrentPlayer as Player
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
'LoadPlayersFromDatabase
End Sub
Public Sub TestMe
Msgbox("","TestMe")
End Sub
Then i have main from which loads the class the the players form
B4X:
Sub Process_Globals
Public Game As clsGame
Game.Initialize
End Sub
Sub Globals
Dim pnlBottom As Panel
Dim pnlTop As Panel
Dim btnStart As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("frmmain")
End Sub
Sub btnStart_Click
StartActivity(frmPlayers)
End Sub
But if i call frmPlayers the class i don't see the Msgbox
B4X:
Sub Globals
Dim btnStart As Button
Dim lstPlayers As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("frmplayers")
End Sub
Sub btnStart_Click
Main.Game.TestMe
End Sub
I only want to load the players once and 'share' the Main.Game between activities.
I hope i makes sense.
Thanks in advance.