Hello
I made a simple program in B4J to create a List with some Type in it. I saved the list in a file and puted on my B4A app.
When I try to open the list file using the same custom type, throws me an error: java.lang.ClassCastException: java.lang.String cannot be cast to com.testprogram.readlistxx$_abc
Isn't possible to do this?
I did something like this in B4J:
And B4A code:
I made a simple program in B4J to create a List with some Type in it. I saved the list in a file and puted on my B4A app.
When I try to open the list file using the same custom type, throws me an error: java.lang.ClassCastException: java.lang.String cannot be cast to com.testprogram.readlistxx$_abc
Isn't possible to do this?
I did something like this in B4J:
B4X:
Type ABC(P As String, X As Int, Y As Int, Z As Int)
Sub CreateList
Dim XX As List
XX.Initialize
For I = 0 To 100
XX.Add(CreateABC("xxxxxxxxx", I, I, I))
Next
File.WriteList(File.DirApp, "xx.inf", XX)
End Sub
And B4A code:
B4X:
Dim XX As List = File.ReadList(File.DirAssets, "xx.inf")
For Each item As ABC In XX
'etc
Next