Sub btnLogin_Click
Toast.Show("Checking user and password...")
Dim Parametros() As String = Array As String(etUser.Text.Trim, etPass.Text.Trim)
Wait For(jRDC.GetRecord("Login", Parametros)) Complete (Answer As Map)
If Answer.Get("Success") Then
Dim l As List
Dim rs As DBResult
rs = Answer.Get("Data")
l = rs.Rows
If l.Size > 0 Then
Dim UserData As List
For Each row() As Object In l
UserData = row
Next
KVS.Put("user", etUser.Text.Trim)
KVS.Put("id_user", UserData.Get(0))
B4XPages.ShowPageAndRemovePreviousPages("Page Data")
Else
xui.MsgboxAsync("Wrong username or password", "Error")
End If
Else
xui.MsgboxAsync("Problem connecting: " & Answer.Get("Error"), "Error")
End If
End Sub