When running my project WITHOUT B4XPages, this works just fine:
But when I convert to using B4XPages, and use the below, I get an error message:
Parsing code. Error
Error parsing program.
Error description: Undeclared variable 'activity' is used before it was assigned any value.
Error occurred on line: 65 (B4XMainPage)
Activity.LoadLayout("options_panel1")
What do I need to do to fix this error?
The documentation says this:
You can also call a second layout from within the first Activity, using Activity.LoadLayout("Layout2").
But that doesn't seem to work.
Thank you.
B4X:
Sub Activity_Create(FirstTime As Boolean)
Dim UR As Int
Activity.LoadLayout("Layout")
Activity.LoadLayout("options_panel1")
Activity.LoadLayout("options_panel2")
cd1.Initialize(Colors.RGB(253, 251, 186), 5dip) 'sets up rounded corners
cd2.Initialize(Colors.RGB(253, 251, 186), 5dip)
Bmp101.Initialize(File.DirAssets, "calendar.png")
Bmp102.Initialize(File.DirAssets, "clock.png")
IME1.Initialize("IME")
p3.Initialize("p3")
Activity.AddView(p3, 0, 0, 100%x, 100%y - 60dip)
But when I convert to using B4XPages, and use the below, I get an error message:
Parsing code. Error
Error parsing program.
Error description: Undeclared variable 'activity' is used before it was assigned any value.
Error occurred on line: 65 (B4XMainPage)
Activity.LoadLayout("options_panel1")
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
Dim txt As String
Dim UR As Int
Dim FirstTime As Boolean
Root = Root1
Root.LoadLayout("MainPage")
Activity.LoadLayout("options_panel1")
Activity.LoadLayout("options_panel2")
cd1.Initialize(Colors.RGB(253, 251, 186), 5dip) 'sets up rounded corners
cd2.Initialize(Colors.RGB(253, 251, 186), 5dip)
Bmp101.Initialize(File.DirAssets, "calendar.png")
Bmp102.Initialize(File.DirAssets, "clock.png")
IME1.Initialize("IME")
p3.Initialize("p3")
Activity.AddView(p3, 0, 0, 100%x, 100%y - 60dip)
What do I need to do to fix this error?
The documentation says this:
You can also call a second layout from within the first Activity, using Activity.LoadLayout("Layout2").
But that doesn't seem to work.
Thank you.