This example demonstrates how you can use a different code module for each page.
B4i structure (like B4J) is very flexible. Pages are regular objects like all other objects. You can use a single module for multiple pages or you can use multiple modules.
In this example we use a different module for each page.
Each module exposes a Show sub that initializes the page if needed and shows it:
B4i structure (like B4J) is very flexible. Pages are regular objects like all other objects. You can use a single module for multiple pages or you can use multiple modules.
In this example we use a different module for each page.
Each module exposes a Show sub that initializes the page if needed and shows it:
B4X:
Public Sub Show
If pg.IsInitialized = False Then
pg.Initialize("pg")
pg.RootPanel.LoadLayout("Page1Layout")
pg.HideBackButton = True '<-- don't want to allow the user to return to the login screen
End If
Label1.Text = "Hello " & LoginModule.txtName.Text
Main.NavControl.ShowPage(pg)
End Sub