Is there any way to set a maximum of Chars to a line in an EditText
Field?
I tried it with a TextWatcher
, But I cant really do what I want.
As you can see in above answers , you cant limit line length in edit text. But you can use text watcher that you mentioned to detect any changes in text. The override methods are self-explanatory in text watcher. Just make sure you dont edit, ie add text to the associated view when using text watcher. It will go in a recursive loop.