Hi all,
I have a project I'm converting from B4A to B4i.
I load the main page using the following statements:
Later I want to load another layout, and the statements are similar:
The code of the module "Activity" (which is merely a wrapper to retain the B4A statements) is:
The runtime error occurs at the statement marked with an arrow.
It complains that the label was not initialized.
The same error is arised also with all the other controls (panels, etc.) of the loaded Layout. The Layout is however displayed after the error.
Should I initialize all the controls of a Layout in order to load it ? With B4A is not needed..
Am I missing something obvious here ?
Regards,
Sergio
I have a project I'm converting from B4A to B4i.
I load the main page using the following statements:
B4X:
NavControl = Nav
.
.
pageMain.Initialize("pageMain")
pageMain.Title = "pageMain"
pageMain.RootPanel.Color = Colors.White
pageMain.RootPanel.LoadLayout("main")
NavControl.ShowPage(pageMain)
Later I want to load another layout, and the statements are similar:
B4X:
Activity.RemoveAllViews
Activity.LoadLayout("training_options")
Activity.Title = "Training Options"
lbl_goMenu.BringToFront ' <--- here occurs the error, even if the label was initialized with a text inside the designer
The code of the module "Activity" (which is merely a wrapper to retain the B4A statements) is:
B4X:
Sub RemoveAllViews
Main.NavControl.RemoveCurrentPage
End Sub
Sub loadLayout(layout As String)
Main.pageMain.Initialize(layout)
Main.pageMain.Title = "page" & layout
Main.pageMain.RootPanel.Color = Colors.White
Main.pageMain.RootPanel.LoadLayout(layout)
Main.NavControl.ShowPage(Main.pageMain)
End Sub
The runtime error occurs at the statement marked with an arrow.
It complains that the label was not initialized.
The same error is arised also with all the other controls (panels, etc.) of the loaded Layout. The Layout is however displayed after the error.
Should I initialize all the controls of a Layout in order to load it ? With B4A is not needed..
Am I missing something obvious here ?
Regards,
Sergio
Last edited: