android:maxLength=”10“意思是最大输入长度10 代码中editText.setFilters(new InputFilter[]{ new InputFilter.LengthFilter(10)});