Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim ed(3) As EditText
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")
For k=0 To 2
ed(k).Initialize("ed")
ed(k).SingleLine=False '<-- You can capture any "enter" key in _textChanged event
ed(k).Text="Hello "& (k+1)
Activity.AddView(ed(k),20%X,20%Y+k*20%Y,60%X,15%Y)
Next
End Sub
Sub ed_EnterPressed
'do nothing
End Sub
Sub ed_TextChanged (Old As String, New As String)
Dim LF0 As String = Chr(10)
Dim CR0 As String = Chr(13) '(=0x0D) carriage return possibly sent by the hardware keyboard along with the LF char (0x0A)
if New.Contains(CR0) Then
Log("Carriage Return detected") <-- extra char sent by your hardware keyboard.
New.Replace(CR0,"") 'Remove unwanted character.
End If
If New.EndsWith(LF0) Then 'This should be the 'normal' enter from the soft keyboard
New.Replace(LF0,"")
' Force jump to the edittext that corresponds
End If
End Sub