Hi am new to B4A and am using version 3.82.My problem is am trying to load the layout pages that i saved in the designer to each tab that i have created.I have successfully designed a tab with 5 tabs on it using the tabhost.The problem is the pages that i intend to display on each tab are not showing even though i have followed every example in the online help and in the beginners guide.Kindly assisst as this would of great help.My code is as below:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim TabHost1 As TabHost
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("home_page")
TabHost1.AddTab("Music","music")
TabHost1.AddTab("Recoder","recoder.bal")
TabHost1.AddTab("Chat","chat")
TabHost1.AddTab("Messages","sign_up")
TabHost1.AddTab("s", "search"
music,recoder,chat,sign_up,search are layout pages made in the designer but i have not generated members of each layout yet.I dont know if this could be a problem
I have also tried using a panel as shown in the beginners guide but the panels/layout pages are not showing once i run the program.the code is as below:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim music,recoder,messages,chat,search As Panel
Dim TabHost1 As TabHost
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("home_page")
TabHost1.AddTab("Music","music")
TabHost1.AddTab("Recoder","recoder")
TabHost1.AddTab("Chat","chat")
TabHost1.AddTab("Messages","messages")
TabHost1.AddTab("s", "search")
the panel variables show a warning that the variables declared in the panel are never used
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim TabHost1 As TabHost
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("home_page")
TabHost1.AddTab("Music","music")
TabHost1.AddTab("Recoder","recoder.bal")
TabHost1.AddTab("Chat","chat")
TabHost1.AddTab("Messages","sign_up")
TabHost1.AddTab("s", "search"
music,recoder,chat,sign_up,search are layout pages made in the designer but i have not generated members of each layout yet.I dont know if this could be a problem
I have also tried using a panel as shown in the beginners guide but the panels/layout pages are not showing once i run the program.the code is as below:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim music,recoder,messages,chat,search As Panel
Dim TabHost1 As TabHost
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("home_page")
TabHost1.AddTab("Music","music")
TabHost1.AddTab("Recoder","recoder")
TabHost1.AddTab("Chat","chat")
TabHost1.AddTab("Messages","messages")
TabHost1.AddTab("s", "search")
the panel variables show a warning that the variables declared in the panel are never used