I'm needing to limit the number of characters a user can input. Since I wasn't able to find any info in the docs I created my own routine which works great except for one thing. It allows the user to exceed the max length by one character before removing it. I would much rather have the user unable to enter anymore characters beyond the max. It looks kinda goofy.
B4X:
Sub EditText1_TextChanged (Old As String, New As String)
Dim pline As String
pline = EditText1.Text
If pline.Length > 40 Then
EditText1.Text = pline.SubString2(0,39)
EditText1.SelectionStart = 39
ToastMessageShow("40 character limit",False)
End If
End Sub