Sub clv1_ItemClick (Index As Int, Value As Object)
expandable.ToggleItem(Index)
Sleep(400) ' stops error
'Title Panel ...
Dim pnlTitle As B4XView = clv1.GetPanel(Index).GetView(0) 'pnlTitle is First Item on Item layout
pnlTitle.GetView(0).Text = "This is a New Title" 'lblTitle is first pnlTitle View
'Items Panel ...
Dim pnlItems As B4XView = clv1.GetPanel(Index).GetView(1) 'pnlExpanded is Second Item on Item layout
pnlItems.GetView(0).Text = "ABC" '1st panel view
pnlItems.GetView(1).Text = "123" '2nd panel view
End Sub
'the same code in a View_Click sub does not require a Sleep() line.
Sub Button2_Click
'no sleep required
Dim index As Int = clv1.GetItemFromView(Sender)
'Title Panel ...
Dim pnlTitle As B4XView = clv1.GetPanel(index).GetView(0) 'pnlTitle is First Item on Item layout
pnlTitle.GetView(0).Text = "This is another new Title !" 'lblTitle is first pnlTitle View
'Items Panel ...
Dim pnlItems As B4XView = clv1.GetPanel(index).GetView(1) 'pnlExpanded is Second Item on Item layout
pnlItems.GetView(0).Text = "DEF" '1st panel view
pnlItems.GetView(1).Text = "456" '2nd panel view
End Sub