Вы можете ограничить длину программно, используя setFilters()
ArrayAdapter<String> My_arr_adapter= new ArrayAdapter<String>(getContext(),android.R.layout.simple_dropdown_item_1line,items);
autoCompleteTextView.setThreshold(2);
autoCompleteTextView.setAdapter(My_arr_adapter);
autoCompleteTextView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) {
autoCompleteTextView.setFilters(new InputFilter[]{ new InputFilter.LengthFilter(255) });
autoCompleteTextView.setText( (String)arg0.getItemAtPosition(arg2));
autoCompleteTextView.setFilters(new InputFilter[]{ new InputFilter.LengthFilter(4) });
}
});
autoCompleteTextView.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
if (charSequence.length()==4){
autoCompleteTextView.setFilters(new InputFilter[]{ new InputFilter.LengthFilter(4) });
}
}
@Override
public void afterTextChanged(Editable editable) {
}
});
Надеюсь, это поможет