Sub Globals
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("Layout1")
Dim cr As ContentResolver
cr.Initialize("")
Dim u As Uri
Dim pr() As String
pr = Array As String ( "_id", "address", "date", "body" )
u.Parse("content://sms/inbox")
Dim crsr As Cursor = cr.Query( u, pr , "read = 0", Null, Null)
Log("Rows " & crsr.RowCount)
Log("Columns " & crsr.ColumnCount)
ListView1.Initialize("ListView1")
For i=0 To crsr.RowCount-1
crsr.Position = i
ListView1.AddSingleLine(crsr.GetString("_id") & "-" & crsr.GetString("date"))
Next
Activity.AddView(ListView1, 0, 0, 100%x, 100%y)
End Sub
Sub ListView1_ItemClick (Position As Int, Value As Object)
Activity.Title = Value
End Sub