I am using this example ScrollViewList.zip from Klaus and would like to know how to save and load the scrollview list to a text file. I don't want to use a SQL database as it seems to be overkill just for a scrollview with labels. I'm not sure how to get the text from the labels in the scrollview panels. If I could I would just save and load the text as a list from a text file. Help would be appreciated. Thanks
OK, I think I have it now using
GetItemView(i).Text to get the contents of the text contents of the Labels
Well, I guess that won't exactly work as I get an error
java.lang.RuntimeException: Object should first be initialized (View).
This is the sub I created to save the list to a file but it is giving me the above error.
This is used with the ScrollViewList example provided by Klaus.
OK, I think I have it now using
GetItemView(i).Text to get the contents of the text contents of the Labels
Well, I guess that won't exactly work as I get an error
java.lang.RuntimeException: Object should first be initialized (View).
This is the sub I created to save the list to a file but it is giving me the above error.
B4X:
Sub WriteList
Dim i As Int
Dim List1 As List
List1.Initialize
For i = 1 To NumberOfRows
List1.Add(GetItemView(i).Text)
Next
File.WriteList(File.DirRootExternal, "List.txt", List1)
End Sub
This is used with the ScrollViewList example provided by Klaus.
Last edited: