If Qty=0 Then
ToastMessageShow("No data", False)
btnFirstSave.Visible = True
Else
Dim i As Int
MySql="SELECT * FROM medication"
cursor1 = SQL1.ExecQuery(MySql)
btnFirstSave.Visible = False
For i =0 To Qty-1
Dim footer As B4XView = xui.CreatePanel("")
footer.SetLayoutAnimated(0,0,0,100%x, 250dip)
footer.LoadLayout("medicines")
CustomListView1.Add(footer,"")
cursor1.Position = i
btnID.Text = cursor1.GetString("id")
btnID.Tag = cursor1.GetString("id")
lblMedication.Text = cursor1.Getstring("drug")
lblDose.Text = cursor1.GetString("dose")
lblIssued.Text = cursor1.GetString("dateissued")
lblNext.Text = cursor1.GetString("lastissue")
lblDirections.Text = cursor1.GetString("directions")
Next
btnFirstSave.Visible = False
End If
End Sub
Sub btnID_Click
Log(btnID.Tag & " - " & btnID.Text)
End Sub