Very simple example got me more confused. I thought I started getting a little handle on this. Why isn't Page2 displayed after B4XMainPage is loaded.:
To explain it better: I want Page2 to be the one visible when the app runs, not B4XMainPage.
B4X:
'Code in B4XMainPage
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private P2 As Page2
End Sub
Public Sub Initialize
P2.Initialize
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage") 'has one button
B4XPages.AddPage("Page2",P2)
B4XPages.ShowPage("Page2")
End Sub
B4X:
'Page2 code:
Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
Public Label1 As B4XView
End Sub
Public Sub Initialize As Object
Return Me
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("2") 'has a label only
End Sub
Last edited: