Android, how fix the max character length/size of EditText
please guide me, i want to fix the size of EditText..
i want that i can enter only 10 character in EditText, af开发者_如何转开发ter that could not type any more that 10 character...
any method is there?
Thanks in advance..
Add this attribute to EditText
android:maxLength="10"
You can define max length by two ways:
In XML
Define attribute of edittext:
android:maxLength = "10"
In JAVA
Define length through programmatically:
edittext_name.setFilters(new InputFilter[] { new InputFilter.LengthFilter(10) });
精彩评论