Issue
I have a EditText
, and I would like to restrict the number of characters which could be inputted in this EditText
, and make this restriction programmatically, how to do it? For example, say I would like to restrict it to only allow 10 characters.
Solution
You can Use InputFilter for restricting the number of characters in EditView programmatically as:
InputFilter[] FilterArray = new InputFilter[1];
FilterArray[0] = new InputFilter.LengthFilter(10);
your_edittext.setFilters(FilterArray);
for more help you can see this tutorial for restricting number of characters in EditView:
Answered By - ρяσѕρєя K
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.