-1

I want to type only letters on the keyboard, no numbers, I used this method and it doesn't work, why?

                <EditText
                android:id="@+id/name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="textPersonName" />
  • Take a look at [what-is-special-about-androidinputtype-textpersonname-for-edittex](https://stackoverflow.com/questions/11731961/what-is-special-about-androidinputtype-textpersonname-for-edittext?lq=1) – B001ᛦ Apr 24 '20 at 08:32
  • Thank u, but how can I display only letters? – Kornel Litwinow Apr 24 '20 at 08:35
  • _...how can I display only letters?..._ [how-to-create-edittext-accepts-alphabets-only-in-android](https://stackoverflow.com/questions/2361497/how-to-create-edittext-accepts-alphabets-only-in-android) – B001ᛦ Apr 24 '20 at 08:39
  • I saw that answers but I thought that is another way – Kornel Litwinow Apr 24 '20 at 08:41
  • Why do you think that that should prevent numbers? Are you assuming that no one has numbers in their name? – Mike M. Apr 24 '20 at 08:45
  • I think yes, who has numbers in name? – Kornel Litwinow Apr 24 '20 at 08:47
  • R2D2. That's robo-descrimination i guess) – Beloo Apr 24 '20 at 09:04
  • 1
    Does this answer your question? [How to create EditText accepts Alphabets only in android?](https://stackoverflow.com/questions/2361497/how-to-create-edittext-accepts-alphabets-only-in-android) – MMG Apr 24 '20 at 10:45

1 Answers1

1

You can use

<EditText
  android:id="@+id/name"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:digits="qwertzuiopasdfghjklyxcvbnmQWERTZUIOPASDFGHJKLYXCVBNM"
/>

need to test though

Nandu
  • 63
  • 11