artist
artist

Reputation: 6371

how to set the max. length of text in edittext control

I would like to know how can I set maximum length of text in an edittext control in android. I want the edittext to be able to handle large amount of text. How can I accomplish this. Thanks

Upvotes: 3

Views: 5085

Answers (2)

caiocpricci2
caiocpricci2

Reputation: 7798

In the xml declaration of the edittext you can add the atribute

android:maxLength="100" // or the size that you want

Upvotes: 3

blessanm86
blessanm86

Reputation: 31779

try this

InputFilter[] FilterArray = new InputFilter[1];
FilterArray[0] = new InputFilter.LengthFilter(8);
editEntryView.setFilters(FilterArray);

Upvotes: 6

Related Questions