Can I?
I have created the TabHost1 no problem and created the Layouts ( page1, page2, page3, page4)
On page3 layout I added the ListView called LV1 the code below shows how I am trying to get it done .... but its not working ,,,,,, Do I need to wait till the Tab is created first? or how do I make this happen at startup of app
I have created the TabHost1 no problem and created the Layouts ( page1, page2, page3, page4)
On page3 layout I added the ListView called LV1 the code below shows how I am trying to get it done .... but its not working ,,,,,, Do I need to wait till the Tab is created first? or how do I make this happen at startup of app
B4X:
Sub Globals
Dim TabHost1 As TabHost
Dim txtName, txtDescription, txtColor As EditText
Dim LV1 As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
Activity.Title = "My Title"
Dim bmp1, bmp2 As Bitmap
bmp1 = LoadBitmap(File.DirAssets, "ic.png")
bmp2 = LoadBitmap(File.DirAssets, "ic_selected.png")
'TabHost1.AddTab("Tag Search", "page1")
TabHost1.AddTabWithIcon ("Search", bmp1, bmp2, "page1") 'load the layout file of each page
TabHost1.AddTab("Alerts", "page2")
TabHost1.AddTab("Calls", "page3")
TabHost1.AddTab("Map", "page4")
LV1.Initialize("LV1")
For i = 1 To 10
LV1.AddSingleLine("Item #" & i)
Next
End Sub