Sub Activity_Create(FirstTime As Boolean)
Dim StationList As ListView
Dim StationCount As Int
Dim i As Int
Dim dir As String
dir = CopyDBFromAssets("lineinfo.db")
SQL1.Initialize(dir,"lineinfo.db",True)
StationList.Initialize("StationList")
StationList.SingleLineLayout.Label.TextColor = Colors.Black
Activity.Color = Colors.white
Activity.LoadLayout("StationFreeSearch") 'this is the layout where the list is
StationCount = SQL1.ExecQuerySingleResult("SELECT count(DISTINCT StationName) FROM lineinfo")
For i = 1 To StationCount
StationList.AddSingleLine(SQL1.ExecQuerySingleResult("SELECT DISTINCT StationName FROM lineinfo WHERE StationAlphaID = " & i )) 'the query is okay in terms of there are no errors in the sql part, but the list remains completely empty.
Next
Activity.LoadLayout("StationFreeSearch")
'Activity.AddView(StationList, 0, 0, 100%x, 100%y) /* im not using these because this doesnt actually utilise the layout. */
'Activity.AddView(Searchbox, 0, 0, 300dip, 100dip) /* ignore this for now */
End Sub