List of usage examples for android.text InputFilter.LengthFilter InputFilter.LengthFilter
public LengthFilter(int max)
From source file:Main.java
public static EditText applyMaxCharsFilter(EditText field, int length) { InputFilter[] FilterArray = new InputFilter[1]; FilterArray[0] = new InputFilter.LengthFilter(length); field.setFilters(FilterArray);//w w w .j a v a 2 s.c o m return field; }