Home » Android » What is special about android:inputType="textPersonName" for EditText

What is special about android:inputType="textPersonName" for EditText

Posted by: admin April 23, 2020 Leave a comment

Questions:

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?

How to&Answers:

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

Answer:

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

Answer:

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