Reputation: 26
So I want to make a button which would modify the max length of a textview. I have been trying to do this or find an answer to it for hours, but I can't find anything. Any help would be really appreciated.
Upvotes: 0
Views: 64
Reputation: 3903
Try this
public void setEditTextMaxLength(int length) {
InputFilter[] FilterArray = new InputFilter[1];
FilterArray[0] = new InputFilter.LengthFilter(length);
edt_text.setFilters(FilterArray);
}
Upvotes: 1