I want to set a 1 character length in EditText but just in one part of condition. There is a way to set max length via XML but this will be applied for the whole condition. How to set max length programmatically?
public void setEditTextMaxLength(EditText editText, int length) {
InputFilter[] FilterArray = new InputFilter[1];
FilterArray[0] = new InputFilter.LengthFilter(length);
editText.setFilters(FilterArray);
}