Sub Class_Globals
Private CLV1 As CustomListView
Private CLV2 As CustomListView
End Sub
...
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
'load the layout to Root
Root.LoadLayout("restaurantMenuLayout") <--- CLV1 is loaded here
CLV2.initialize("CLV2","")
CLV2.AsView.Tag = CLV2 <---- Error(?) - This will not reference CLV2 Really because it isn't instantiated yet (I think)
CLV1.Add(createOfertas,"ofertas")
End Sub
Private Sub createOfertas As B4XView
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0,0,0,100%x,200dip)
p.LoadLayout("restaurantMenuOfertas")
Dim clvPanel As CustomListView = p.GetView(0).tag
clvPanel.Add(createOfertasItens,"ofertas")
Return p
End Sub
Private Sub createOfertasItens As B4XView
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0,0,0,100%x,200dip)
p.LoadLayout("restaurantMenuOfertaItem") <--- Here is a design with CLV2 only (index 0)
p.Width = 80dip
p.Height = 200dip
Return p
End Sub