I know that a few questions have already been asked, but I have a slightly different request.
How to set a limit on the maximum number of characters entered in EditText ? I'm doing it
android:maxLength="7"
or
((EditText)findViewById(R.id.zip)).setFilters(new InputFilter[] { new InputFilter.LengthFilter(7) });
I can still enter a text box, although it is not visible and not taken into account. If I continue to type, the input becomes invisible after the limit, but test-suggestions are built for more letters.
Suppose my limit is 7, and I typed 10 letters, then I will see only the first 7 letters, but text sentences will show 10 letter words. In addition, I need to press 3 times back to actually start deleting letters from my 7-letter word.
So my question is: is there a way to stop accepting input after a certain character length?
PS : Needless to say, but although I do not want to enter input after 7 letters, I would allow deletion or backspace.
source share