hi
i want to add list and after exit its save and after open its open the list
im using this code why its not work
i want to add list and after exit its save and after open its open the list
im using this code why its not work
B4X:
Dim ListView1 As ListView
Dim list1 As List
Sub Activity_Create
ReadOptions
End Sub
Sub Activity_Pause (UserClosed As Boolean)
list1 = listview1
saveOptions
End Sub
Sub SaveOptions
Dim TW As TextWriter
TW.Initialize(File.OpenOutput(File.DirInternal, "file.txt", False))
TW.WriteList(List1)
TW.Close
End Sub
Sub ReadOptions
If File.Exists(File.DirInternal, "file.txt") = False Then Return
Dim TW As TextReader
TW.Initialize(File.OpenInput(File.DirInternal, "file.txt"))
list1 = TW.ReadList
TW.Close
End Sub