B4J Question Save tableview items to file

LucianoB

Member
Licensed User
Longtime User
I'd like to save to a txt file the items currently existing in a tableview.
I have this code but the rows written in the txt file are like this one:
[Ljava.lang.String;@514c7262

B4X:
File.OpenOutput(LogFolder,LogFilename,True)
Dim LogList As List
LogList.Initialize
           
For c = 0 To TableView1.Items.Size - 1
     LogList.Add(TableView1.Items.Get(c))
     Log(LogList.Get(c))
Next
File.WriteList(LogFolder,LogFilename,LogList)

What am I doing wrong?
Thank you
 

LucianoB

Member
Licensed User
Longtime User
Well, sorry. I changed my code with:

B4X:
File.OpenOutput(LogFolder,LogFilename,True)
Dim LogList As List
LogList.Initialize
         
For c = 0 To TableView1.Items.Size - 1
    Dim r() As String = TableView1.Items.Get(c)
    LogList.Add(r(0))
    Log (r(0))
Next
File.WriteList(LogFolder,LogFilename,LogList)

and now it works.
 
Last edited:
Upvote 0
Top