Hello, I am very new with B4A and run into a problem with saving a list.I want to save different BT connections in a list.(to show in listview)
I save with:
I would like to read with:
Problem:
When reading the saved templist the elementdata looks like:
0=[IsInitialized=false, Mac=20:13:10:15:43:01, Name=HC-05
1=]
I thought there was a crlf in the name or the line was too long so I substitute the name with a "1".. This did not help.. How can it be that it is divided into 2 elements and I cna not read it back into the list??
B4X:
Type NameAndMac (Name As String, Mac As String)
dim NM as nameandmac
B4X:
templist.Add(connectedDevice)
File.WriteList(File.DirRootExternal,"MyList.txt",templist)
I would like to read with:
B4X:
If File.Exists(File.DirRootExternal, "MyList.txt") Then
templist = File.ReadList(File.DirRootExternal,"MyList.txt")
For i = 0 To templist.Size - 1
Dim nmtemp As NameAndMac
nmtemp = templist.Get(i)
lstUsedDevices.AddSingleLine2(nmtemp.Name,nmtemp.Mac)
Next
End If
Problem:
When reading the saved templist the elementdata looks like:
0=[IsInitialized=false, Mac=20:13:10:15:43:01, Name=HC-05
1=]
I thought there was a crlf in the name or the line was too long so I substitute the name with a "1".. This did not help.. How can it be that it is divided into 2 elements and I cna not read it back into the list??