Android Code Snippet EditText Max Length

More shorter code compared to here

Example:
B4X:
Sub Globals   
    Dim txtPIN As EditText
End Sub

Sub txtPIN_TextChanged (Old As String, New As String)
    If New.Length > 6 Then
        txtPIN.Text = Old
        txtPIN.SelectionStart = Old.Length
    End If  
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…