One xCLV and one PCLV side by side accessing the same Items layout which has a label, named LblText Both access the same list data. This code works on the first xCLV, but crashes obviously on the PCLV for good reasons that escape me:
How can you still click the labels on the PCLV without it crashing. I also tried to use: clv1.AsView.Tag=clv1 and clv3.AsView.Tag=clv3
B4X:
Sub LblText_Click
Dim Index As Int=clv1.GetItemFromView(Sender) ‘line 71
Dim p As B4XView=clv1.GetPanel(Index)
Log(p.GetView(0).text)
End Sub
B4X:
Error occurred on line: 71 (Main)
java.lang.ClassCastException: android.view.ViewRootImpl cannot be cast to android.view.View
at anywheresoftware.b4a.objects.B4XViewWrapper.asViewWrapper(B4XViewWrapper.java:88)
at anywheresoftware.b4a.objects.B4XViewWrapper.getParent(B4XViewWrapper.java:185)