1

I am developping an application for Android and I would like to limit an EditText to only 2 characters. Do you have an idea about this ?

Nachding
  • 455
  • 2
  • 10
  • 19

2 Answers2

2

Add android:maxLength="2" to xml.

wwang
  • 595
  • 1
  • 4
  • 13
1

In your EditText XML add this

android:maxLength="2"
Chris Stillwell
  • 9,821
  • 9
  • 70
  • 73