I got error java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.String[] when trying savecsv. Anyone can help me ? Please.
B4X:
Sub savedata
Dim su As StringUtils
Dim sb As StringBuilder
Dim rows As List
rows.Initialize
sb.Initialize
Dim ob,co,dw As Int
Dim Arr(3) As String
co=txtmpco.Text.Replace(",","")
ob=txtmpob.Text.Replace(",","")
dw=txtmpco.Text.Replace(",","")
Arr(0)=ob
Arr(1)=co
Arr(2)=dw
rows.AddAll(Arr)
Log(rows)
su.SaveCSV(File.DirDefaultExternal,"MP0320.CSV",",",rows)
End Sub
Are you trying to say something like this or am I bucking your train of thought and messing with your solution?
B4X:
Dim i As Int
For Each row() As String In rows
Dim list As List = row
For j=0 To list.Size-1
Log(list.Get(j)) 'display the individual items
Next
i=i+1
Next