Hi, my app collects values from the user, adds them to a history list and a history table (table module) and then should save the table. However, the save crashes with a java.lang.ClassCastException: java.lang.Object[] cannot be cast to java.lang.String[]
Here is the relevant portion of the code
timestamp is a long, all the other arguments are strings. However, if I change timestamp to string, same problem.
Help much appreciated!
Here is the relevant portion of the code
B4X:
Dim historyListitem As Object = Array (Datum,spnHour.SelectedItem,spnMinute.SelectedItem,txtSys.Text,txtDia.Text,txtPuls.Text,timestamp)
historyList.Add (historyListitem)
historyTable.ClearAll 'table from the table module
For i = 0 To historyList.Size-1 'discard the header
Dim hti() As Object = Array(7) 'hti = history list item
hti = historyList.Get(i)
historyTable.AddRow(Array As String(hti(0),hti(1),hti(2),hti(3),hti(4),hti(5),hti(6))) 'works
Next
'now write back the table to the csv file
SU.SaveCSV(File.DirInternal,"history.csv",",",historyList)
'crashes with java.lang.ClassCastException: java.lang.Object[] cannot be cast to java.lang.String[]
timestamp is a long, all the other arguments are strings. However, if I change timestamp to string, same problem.
Help much appreciated!