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
  • 465
  • 2
  • 10
  • 20

2 Answers2

2

Add android:maxLength="2" to xml.

wwang
  • 605
  • 1
  • 5
  • 13
1

In your EditText XML add this

android:maxLength="2"
Chris Stillwell
  • 10,266
  • 10
  • 67
  • 77