Android Question TableView cell_click ClassCastException

sgarabinas

Member
Licensed User
Longtime User
I use the following code to catch the cell click in a tableview
In Rapid Debug it works perfectly bur in Release or Legacy Debug returns a cast exception

Sub Cell_Click
If Keyb.Visible = False Then
NewCell = True
Dim rc As ParRowCol
Dim l As Label
l = Sender
rc = l.Tag
If CurRow <> rc.Row OR CurCol <> rc.Col Then NewCell = True
CurRow = rc.Row
CurCol = 2
FillKeyb(CurRow)
End If
End Sub

java.lang.ClassCastException: com.garabinas.dbutils$_rowcol cannot be cast to com.garabinas.modpar$_parrowcol
at com.garabinas.modpar._cell_click(modpar.java:943)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:173)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:161)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:157)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:66)
at android.view.View.performClick(View.java:4452)
at android.view.View$PerformClick.run(View.java:18428)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5365)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
java.lang.ClassCastException: com.garabinas.dbutils$_rowcol cannot be cast to com.garabinas.modpar$_parrowcol
 

sgarabinas

Member
Licensed User
Longtime User
How is ParRowCol defined ?
It seems that the types of ParRowCol and RowCol are different.
You should use Dim rc As RowCol.

You are right, didn't notice that. It works fine now. But why in Rapid Debug was working ??? lol
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…