In my Android application I have different EditText
where the user can enter information. But I need to force user to write in uppercase letters.
Do you know a
You can add the android:textAllCaps="true"
property to your xml file in the EditText. This will enforce the softinput keyboard to appear in all caps mode. The value you enter will appear in Uppercase. However, this won't ensure that the user can only enter in UpperCase
letters. If they want, they can still fall back to the lower case letters. If you want to ensure that the output of the Edittext
is in All caps, then you have to manually convert the input String using toUpperCase()
method of String
class.