android editText max limit
11,103
In XML itself for EditText give the following Attrib,
android:maxLength="20"
Author by
Buda Gavril
Updated on June 11, 2022Comments
-
Buda Gavril almost 2 years
After I set the max character limit for an editText using InputFilter.LengthFilter, is there a way to make editText to react at onTextChanged after it reaches the maximum number of characters? if not, is there a simple way to set a max number of characters to an editText and still react at onTextChanged event?
-
Buda Gavril about 13 yearsmy max length is variable... it depends on some variables, so I have to set it from code.
-
Ganapathy C about 13 yearsthen try this InputFilter[] FilterArray = new InputFilter[1]; FilterArray[0] = new InputFilter.LengthFilter(variable); editEntryView.setFilters(FilterArray);
-
Buda Gavril about 13 yearsthis is what I've done, but after the maximum limit is reached, I can't canch the event when user wants to type