I have a program that requires multiple layouts. And I have them all created.
When the program stats it creates activity will normal and I have it set up to load the first layout.
Activity.LoadLayout("firstscreen")
and that works fine but when a button is push on this screen I need it to "unload" the current layout and load the next one. Can this be down? If so could you guys upload and example.
The Android-like solution would not be one activity with multiple layouts but multiple activities, each with one layout. There is an example in the beginner's guide.
I have a program that requires multiple layouts. And I have them all created.
When the program stats it creates activity will normal and I have it set up to load the first layout.
Activity.LoadLayout("firstscreen")
and that works fine but when a button is push on this screen I need it to "unload" the current layout and load the next one. Can this be down? If so could you guys upload and example.
I'm not sure if I understood what your issue is. Try the following code. Let us know if this was helpful.
Cheers
B4X:
Sub Globals
Dim New_Layout as Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main_Layout")
New_Layout.Initialize("")
New_Layout.LoadLayout("New_Layout_file_from_Designer")
Activity.AddView(New_Layout, 0,0,100%x,100%y)
New_Layout.Visible = False
End Sub
Sub Load_new_Layout_Button_Click
New_Layout.Visible = true
End Sub
Sub Unload_Layout_Button_Click
New_Layout.RequestFocus
New_Layout.Visible = False
End sub
As already suggested, read the Beginner's Guide.
Especialy chapter 12.2 Program with 3 Activities,
Instead of different Panels and a layout on each you should use one Activity per layout.