Y yzhy-mail Member Jan 20, 2022 #1 I use " B4XSerializator" . I want to konw if I can use it like this : “use one list to carry several array in it” I define a “Type MyMessage”. “Type MyMessage” has lists in it. I use the each list to carry some array . like this: Type MyMessage (TX_newlist As List, TX_changedlist As List) When I want to get the array in the list from the receiver like this: Code: For i = 0 To mm_get.TX_newlist.size-1 [U] Dim tem() As String = mm_get.TX_newlist.Get(i) 'ERROR THERE ![/U] For j = 0 To mm_get.TX_newlist.Get(i).size MP.SQL1.ExecNonQuery2(MP.addEvents,tem) Next Sometime I get error like this: java.lang.ClassCastException: class [Ljava.lang.Object; cannot be cast to class [Ljava.lang.String; ([Ljava.lang.Object; and [Ljava.lang.String; are in module java.base of loader 'bootstrap')
I use " B4XSerializator" . I want to konw if I can use it like this : “use one list to carry several array in it” I define a “Type MyMessage”. “Type MyMessage” has lists in it. I use the each list to carry some array . like this: Type MyMessage (TX_newlist As List, TX_changedlist As List) When I want to get the array in the list from the receiver like this: Code: For i = 0 To mm_get.TX_newlist.size-1 [U] Dim tem() As String = mm_get.TX_newlist.Get(i) 'ERROR THERE ![/U] For j = 0 To mm_get.TX_newlist.Get(i).size MP.SQL1.ExecNonQuery2(MP.addEvents,tem) Next Sometime I get error like this: java.lang.ClassCastException: class [Ljava.lang.Object; cannot be cast to class [Ljava.lang.String; ([Ljava.lang.Object; and [Ljava.lang.String; are in module java.base of loader 'bootstrap')
Solution Erel Jan 20, 2022 Don't use arrays. Use Lists. Only arrays of objects (and bytes) are supported.
Erel B4X founder Staff member Licensed User Longtime User Jan 20, 2022 #2 Don't use arrays. Use Lists. Only arrays of objects (and bytes) are supported. Upvote 0 Solution