I'm successfully using CustomListView and it's great. However, I've added a SwitchView (class) as one of the views, and although it appears nicely on the display, I can't capture the CheckedChange event. This is the CheckedChange code:
The problem is that SwitchView is not recognized as an Android view so it crashes at sv=pnl.GetView(2). Is there something I should be doing to eliminate or get around this problem, or is a class like Switchview just not usable with CustomListView?
B4X:
Sub sw_CheckedChange(Checked As Boolean)
Dim index As Int
index = clv.GetItemFromView(Sender)
Dim pnl As Panel
pnl = clv.GetPanel(index)
Dim sv As SwitchView
sv = pnl.GetView(2)
Msgbox("Switch: " & index & CRLF & "Position: " & sv.Checked, "")
End Sub
The problem is that SwitchView is not recognized as an Android view so it crashes at sv=pnl.GetView(2). Is there something I should be doing to eliminate or get around this problem, or is a class like Switchview just not usable with CustomListView?