I would like to programmatically set maxLength property of TextView as I don\'t want to hard code it in the layout. I can\'t see any set
maxLength
TextView
set
For those of you using Kotlin
fun EditText.limitLength(maxLength: Int) { filters = arrayOf(InputFilter.LengthFilter(maxLength)) }
Then you can just use a simple editText.limitLength(10)