Setting Lenght Limit in editText in Java
In my Android app, I will take the name of the person with an
editText. Then, I will send it to a
textView to show that in the subsequent activities. But, I have a limited area. That's why I have to limit the length of the name. In XML, we can restrict the character length with a code called
maxLength. However, I don't want to use it because I want to limit the text within the design limits.
I will visualize the reason why I don't want to use this method. Let's imagine that the person wants to use 8-Z(ZZZZZZZZ) as a name; on the other hand, another person wants to use 8-i(iiiiiiii). Of course, their actual length will be different in design. So, I want to limit the name based on its length on design instead of its character length. I'm waiting for your contributions and suggestions.