B4J Question How we can save and read the tableview content strings and numbers on a CSV tex file?

omarruben

Active Member
Licensed User
Longtime User
this should be easy and straight:

SAVING FROM A TABLEVIEW

B4X:
Dim su As StringUtils
Dim finalList As List
finalList.Initialize
  
   For Each Row() As Object In tablePlaylist.Items
       Dim temp(Row.Length) As String
           
       For i=0 To Row.Length-1
           temp(i) = Row(i)
       Next

       finalList.Add(temp)
      
   Next

   su.SaveCSV(File.DirApp,"playlist.csv",",",finalList)

now how to read from the file to the tableview?
 
Upvote 0

omarruben

Active Member
Licensed User
Longtime User
to read from file to tableview
B4X:
Dim su As StringUtils
   Dim finalList As List
   finalList = su.LoadCSV(File.DirApp,"playlist.csv",",")
   For Each row() As Object In finalList
       tablePlaylist.Items.Add(row)
   Next
 
Upvote 0
Top