B4X:
Activity.LoadLayout("LoadChats")
Dim rs As ResultSet = Starter.oSQL.ExecQuery("SELECT Timestamp, Account, Names,Sms FROM tbl_Messagesdata")
Do While rs.NextRow
Dim sms As String
Dim Accountk As String
Dim Namesk As String
sms=rs.GetString("Sms")
Accountk=rs.GetString("Account")
Namesk=rs.GetString("Names")
CLV1.Add(CreateItem(CLV1.AsView.Width, sms,Accountk,Namesk), "")
Loop
rs.Close
End Sub
Private Sub CreateItem(Width As Int, Content As String,Accountk As String,Namesk As String) As Panel
Dim p As B4XView = xui.CreatePanel("")
Dim height As Int = 200dip
If GetDeviceLayoutValues.ApproximateScreenSize < 4.5 Then height = 350dip
p.SetLayoutAnimated(0, 0, 0, Width, height)
p.LoadLayout("CardChats")
Account.Text = Accountk
Names.Text = Namesk
lblContent.Text = Content
Return p
End Sub