Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim s As SQL
Dim c As Cursor
Dim ListView1 As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("download")
If File.Exists(File.DirDefaultExternal,"marja.db") = False Then
File.Copy(File.DirAssets,"marja.db",File.DirDefaultExternal,"marja.db")
End If
s.Initialize(File.DirDefaultExternal, "marja.db",False)
c=s.ExecQuery("SELECT title,id FROM category")
For i=0 To c.RowCount-1
c.Position=i
ListView1.AddSingleLine(c.GetString("title"))
Next
End Sub
Sub ListView1_ItemClick (Position As Int, Value As Object)
c=s.ExecQuery("SELECT title,id FROM category WHERE title=" & "'" & Value & "'")
For i=0 To c.RowCount-1
c.Position=i
ListView1.AddSingleLine(c.GetString("id"))
Next
End Sub