I'm having trouble figuring this out.
I create a list called Book. Then I load in a csv file that has 5 items per line.
I can then match a Value from a listview and get the info from the Book list by putting it into an array
If I use newlist.addall(cells) the info is added on separate lines in the list.
If I use newlist.add(cells) and then try to place it in a listview
I get this [Ljava.lang.String;@4135d700 in the listview.
I need to create a list just like the book list with multiple items per line that I can access in the same fashion to manipulate and then I can save it back to a different .csv file
Thanks
Jamie.
I create a list called Book. Then I load in a csv file that has 5 items per line.
B4X:
Book.Initialize
Book = su.LoadCSV(File.DirRootExternal, "Book.csv", ",")
B4X:
Sub ListView2_ItemLongClick (Position As Int, Value As Object)
For i = 0 To Book.Size -1
Dim cells() As String
cells = Book.Get(i)
If Value = cells(0) Then
Dim result As Int
result = Msgbox2("Save ?"& CRLF & cells(0) &"="& cells(1)"="&cells(2)&"="&cells(3), "", "Yes", "", "No", Null)
If result = DialogResponse.POSITIVE Then
newlist.addall(cells) 'this is where my problem seems to be
Log("Newlist size=" & newlist.Size) '1 if using .add and 5 if using .addall
ListView3.Visible=True
ListView3.AddSingleLine(newlist.Get(0)) 'using 0 position for testing only
End If
End If
Next
End Sub
If I use newlist.add(cells) and then try to place it in a listview
I get this [Ljava.lang.String;@4135d700 in the listview.
I need to create a list just like the book list with multiple items per line that I can access in the same fashion to manipulate and then I can save it back to a different .csv file
Thanks
Jamie.