8
votes

I have an edit text field. When the user clicks on it by default it shows small letters on the virtual keyboard.

I want by default to display first letter caps and rest of them small on the keyboard.

How can this be done?

5
Have a look @ InputMethodManager Methodukanth

5 Answers

10
votes

android:capitalize is deprecated. So please use: android:inputType

android:inputType="textCapSentences"
6
votes

Try adding android:capitalize="sentences" to the definition of the EditText in your Layout file. This should capitalize the first character of the sentence. If you want to begin each word with a capital letter use words.

More about this can be found in the API.

5
votes

In order to captialize every character of EditText use these property.

android:capitalize="characters"
3
votes

I used below attribute with textCapCharacters value in my EditText to turn on caps lock on the virtual keypad and it worked.

android:inputType="textCapCharacters"
1
votes

To capitalize all characters of Keyboard use this in your edittext in xml:

android:inputType="textCapCharacters"

To capitalize of the first character of every sentence use this :

android:inputType="textCapSentences"