Private Sub LoadIndices
Dim ser As B4XSerializator
ser.Tag = 1
ser.ConvertBytesToObjectAsync(Bit.InputStreamToBytes(File.OpenInput(File.DirAssets,"first.dat")),"ser")
End Sub
Private Sub ser_BytesToObject (Success As Boolean, NewObject As Object)
Log(NewObject)
ProgressBar1.Visible = False
If Success Then
Dim ser As B4XSerializator = Sender
Log($"BytesToObject: ${ser.Tag}"$)
If ser.Tag = 1 Then
firstIndex = NewObject
sv.LoadFirst(firstIndex)
ser.Tag = 2
'read the secondary index
ser.ConvertBytesToObjectAsync( _
Bit.InputStreamToBytes(File.OpenInput(File.DirAssets, "second.dat")), "ser")
Else if ser.Tag = 2 Then
secondIndex = NewObject
End If
End If
End Sub