Hi,
My app includes an activity with slidingPanels, there are 4 of them.
The panels contain standard listviews and customListviews. The code below adds touch listeners so that swiping over the listview will cause the panel to slide
Everything works properly with the standard listviews but When the r2 & r3 reflectors are added for the customListviews, the following error occurs at runtime:
Any help with why this error is occurring would be much appreciated...
Thanks.
My app includes an activity with slidingPanels, there are 4 of them.
The panels contain standard listviews and customListviews. The code below adds touch listeners so that swiping over the listview will cause the panel to slide
B4X:
'listviews do not have events & properties needed to recognize a swipe
'wrap listviews with touch listeners to handle swipes over listviews
Dim r1,r1b,r2,r3,r4 As Reflector
r1.Target = lv1
r1.SetOnTouchListener("Listview_Touch")
r1b.Target = lv1b
r1b.SetOnTouchListener("Listview_Touch")
r2.Target = clvs1
r2.SetOnTouchListener("Listview_Touch")
r3.Target = clvs2
r3.SetOnTouchListener("Listview_Touch")
r4.Target = lv4
r4.SetOnTouchListener("Listview_Touch")
Everything works properly with the standard listviews but When the r2 & r3 reflectors are added for the customListviews, the following error occurs at runtime:
B4X:
claimdetails_activity_create (B4A line: 99)
r2.SetOnTouchListener("Listview_Touch")
java.lang.ClassCastException: com.bcc.mobibcd.customlistview
at anywheresoftware.b4a.agraham.reflection.Reflection.SetOnTouchListener(Reflection.java:1113)
at com.bcc.mobibcd.claimdetails._activity_create(claimdetails.java:396)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at com.bcc.mobibcd.claimdetails.afterFirstLayout(claimdetails.java:89)
at com.bcc.mobibcd.claimdetails.access$100(claimdetails.java:16)
at com.bcc.mobibcd.claimdetails$WaitForLayout.run(claimdetails.java:74)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
java.lang.ClassCastException: com.bcc.mobibcd.customlistview
Any help with why this error is occurring would be much appreciated...
Thanks.