39

I tried

        <EditText
            android:id="@+id/editText1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:ems="10"
            android:inputType="textPersonName" >

I realize it can accept any characters. So, what is special having android:inputType="textPersonName", compared to not having it?

Cheok Yan Cheng
  • 47,586
  • 132
  • 466
  • 875

3 Answers3

41

The difference is that if you use "textPersonName", the user can not insert new lines (the enter button is not showed)

angrymadcat
  • 554
  • 4
  • 11
20

Spelling check is not done when using android:inputType="textPersonName" but it is done in textCapWords.

So if you use textPersonName there won't be red underline for names but first letter of each name (firstname, middlename, lastname etc) won't be capitalized.

so best solution is combining both with an or that is android:inputType="textPersonName|textCapWords".

now there won't be red underline for name and first letter would be capitalized also

Jilson
  • 569
  • 5
  • 11
0

i am testing on android 5.0.1 and i insert a edittext with "textPersonName" input type and other edittext with "text" input type and in the two example the enter button is not showed. i really dont see differences between these input types.

regards