I have a map with custom types. After saving and loading with next appstart the map is somehow not loaded correctly. Holding mouse over the map, the Name-Value View is not expandable, I see only this:
[btm=, [B]bezeichnung[/B]=fff, IsInitialized=true, preis=0.0, textfarbe=0, textsize=0]
and the error in the last line is: java.lang.RuntimeException: Field: bezeichnung not found in: java.lang.String
[btm=, [B]bezeichnung[/B]=fff, IsInitialized=true, preis=0.0, textfarbe=0, textsize=0]
and the error in the last line is: java.lang.RuntimeException: Field: bezeichnung not found in: java.lang.String
B4X:
Sub LoadImages
lst_Buttonprops.Initialize
'Return
Dim sDir As String = File.DirInternal
Dim sFile As String = "productlist.dat"
If File.Exists(sDir, sFile) Then
lst_Buttonprops = File.ReadMap(sDir, sFile)
End If
End Sub
Sub SaveImages
Dim sDir As String = File.DirInternal
Dim sFile As String = "productlist.dat"
File.WriteMap(sDir, sFile, lst_Buttonprops)
End Sub
Dim sKey As String = "Pos" & i
If map.ContainsKey(sKey) Then
Dim tPr As typProps' = lst.Get(i)
tPr = map.Get(sKey)
If tPr.bezeichnung <> "" Then btn.Text = tPr.bezeichnung