Hi,
I have a Layout contain a Edittext, I want to get EnterPressed event for edittext and i want to use it multiple times...My code is.
I have a Layout contain a Edittext, I want to get EnterPressed event for edittext and i want to use it multiple times...My code is.
B4X:
Sub txAddItem_EnterPressed
Try
' If HasFocus =True Then
'Calculation.GetListItem
Dim cur As Cursor
Dim getItem As String
Dim list_add As List
Dim listId As Int
list_add.Initialize
cur=Calculation.Sqlcnn.ExecQuery("Select reason from tbl_reason")
For i=0 To cur.RowCount-1
cur.Position=i
list_add.Add(cur.GetString("reason"))
Next
listId=InputList(list_add,"Select An Item",1)
getItem=list_add.get(listId)
txAddItem.Text =getItem
' End If
Catch
End Try
End Sub
Last edited: