Hello,
i am implmenting a custom ListView. The idea is to have a CustomView that holds a ScrollView in it. The Panel of the ScrollView holds other CustomViews that represents the List Items. The CustomView that represents an Item contains some Views. One of the View is a custom label class:
Everything is fine, the List is initialized and displayed properly with the items.
But the problem is that i can't pass the Click-Event of the Label (CustomView3) to the Custom List (CustomView1). It seems that i can only send events to Activity Modules but not to CustomViews. When i call CallSub with a CustomView-Object as the "Component" i get an error Message:
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (activities) Create, isFirst = true **
** Activity (activities) Resume **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (activities) Create, isFirst = true **
** Activity (activities) Resume **
java.lang.Exception: Sub lbl1_click signature does not match expected signature.
java.lang.Exception: Sub lbl1_click signature does not match expected signature.
java.lang.Exception: Sub lbl1_click signature does not match expected signature.
java.lang.Exception: Sub lbl1_click signature does not match expected signature.
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (activities) Create, isFirst = true **
** Activity (activities) Resume **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (activities) Create, isFirst = true **
** Activity (activities) Resume **
ylabel_label_click (B4A line: 103)
CallSub(module, event_name & "_Click")
java.lang.RuntimeException: java.lang.ClassCastException: anywheresoftware.b4a.objects.ScrollViewWrapper$MyScrollView cannot be cast to java.lang.String
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:847)
at anywheresoftware.b4a.keywords.Common.CallSubNew(Common.java:785)
at yv3.yDiary.ylabel._label_click(ylabel.java:484)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at anywheresoftware.b4a.agraham.reflection.Reflection$2.onClick(Reflection.java:985)
at android.view.View.performClick(View.java:4240)
at android.view.View$PerformClick.run(View.java:17721)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassCastException: anywheresoftware.b4a.objects.ScrollViewWrapper$MyScrollView cannot be cast to java.lang.String
at anywheresoftware.b4a.keywords.Common.getComponentBA(Common.java:958)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:830)
... 18 more
java.lang.RuntimeException: java.lang.ClassCastException: anywheresoftware.b4a.objects.ScrollViewWrapper$MyScrollView cannot be cast to java.lang.String
Any idea how to solve the Problem?
Greetings yv3
i am implmenting a custom ListView. The idea is to have a CustomView that holds a ScrollView in it. The Panel of the ScrollView holds other CustomViews that represents the List Items. The CustomView that represents an Item contains some Views. One of the View is a custom label class:
Everything is fine, the List is initialized and displayed properly with the items.
But the problem is that i can't pass the Click-Event of the Label (CustomView3) to the Custom List (CustomView1). It seems that i can only send events to Activity Modules but not to CustomViews. When i call CallSub with a CustomView-Object as the "Component" i get an error Message:
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (activities) Create, isFirst = true **
** Activity (activities) Resume **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (activities) Create, isFirst = true **
** Activity (activities) Resume **
java.lang.Exception: Sub lbl1_click signature does not match expected signature.
java.lang.Exception: Sub lbl1_click signature does not match expected signature.
java.lang.Exception: Sub lbl1_click signature does not match expected signature.
java.lang.Exception: Sub lbl1_click signature does not match expected signature.
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (activities) Create, isFirst = true **
** Activity (activities) Resume **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (activities) Create, isFirst = true **
** Activity (activities) Resume **
ylabel_label_click (B4A line: 103)
CallSub(module, event_name & "_Click")
java.lang.RuntimeException: java.lang.ClassCastException: anywheresoftware.b4a.objects.ScrollViewWrapper$MyScrollView cannot be cast to java.lang.String
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:847)
at anywheresoftware.b4a.keywords.Common.CallSubNew(Common.java:785)
at yv3.yDiary.ylabel._label_click(ylabel.java:484)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at anywheresoftware.b4a.agraham.reflection.Reflection$2.onClick(Reflection.java:985)
at android.view.View.performClick(View.java:4240)
at android.view.View$PerformClick.run(View.java:17721)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassCastException: anywheresoftware.b4a.objects.ScrollViewWrapper$MyScrollView cannot be cast to java.lang.String
at anywheresoftware.b4a.keywords.Common.getComponentBA(Common.java:958)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:830)
... 18 more
java.lang.RuntimeException: java.lang.ClassCastException: anywheresoftware.b4a.objects.ScrollViewWrapper$MyScrollView cannot be cast to java.lang.String
Any idea how to solve the Problem?
Greetings yv3